# Config File Semantic Diff

Compare JSON, YAML, TOML, and dotenv configurations by key path while ignoring ordering and formatting noise.

> Canonical page: https://elysiatools.com/en/tools/config-file-semantic-diff

- **Category:** Development

- **Keywords:** config diff, semantic diff, yaml diff, json diff, toml diff, dotenv

## Overview

Parse both inputs into values, recursively compare objects and arrays, and classify each path as added, removed, changed, or type-changed. Arrays remain order-sensitive because their order is usually configuration semantics. dotenv scalar literals are interpreted as numbers, booleans, null, or strings so cross-format comparisons are useful.

## Inputs

- **Left configuration** (textarea): { "server": { "port": 8080 } }
- **Format** (select)
- **Right configuration** (textarea): server: port: 9090
- **Format** (select)

## When to use

- Review configuration changes before deployment without being distracted by formatting or key order.
- Compare configurations written in different supported formats, such as JSON and YAML.
- Audit dotenv environment variables for additions, removals, and value changes.

## How it works

- Enter the left and right configuration texts.
- Choose JSON, YAML, TOML, dotenv, or Auto detect for each input.
- The tool parses both configurations and recursively compares objects and arrays by key path.
- Review the HTML result showing added, removed, changed, and type-changed paths.

## Use cases

- Check deployment configuration changes across JSON and YAML files.
- Audit environment variable updates between dotenv configurations.
- Verify that a reformatted or reordered configuration retains the same values.

## Frequently asked questions

### Which configuration formats are supported?

The tool supports JSON, YAML, TOML, and dotenv.

### Does key order affect the comparison?

No. Object key order and formatting differences are ignored.

### Are array order differences ignored?

No. Arrays remain order-sensitive because their order can affect configuration meaning.

### What types of changes are reported?

The result classifies paths as added, removed, changed, or type-changed.

### Can I compare different configuration formats?

Yes. For example, you can compare JSON with YAML or dotenv when both represent compatible values.

## Related tools

- [Environment Config Diff Visualizer](https://elysiatools.com/en/tools/environment-config-diff-visualizer): Compare dev, staging, and production configuration bundles across JSON, YAML, TOML, or ENV formats and highlight drift, missing keys, and cleanup suggestions
- [JSONata Query & Transform Studio](https://elysiatools.com/en/tools/jsonata-query-transform-studio): Preview JSONata-style queries and transformations, compare results across sample payloads, and export the transformed output as JSON, CSV, YAML, or Markdown
- [TOML / INI / HCL / .env / Nix / dotenv ⇄ Kubernetes ConfigMap & Secret Config Format Bridge](https://elysiatools.com/en/tools/toml-ini-hcl-envfile-nix-dotenv-kubernetes-configmap-secret-config-format-bridge): Convert configuration files between dotenv .env, TOML, INI, Java .properties, YAML, JSON, HCL (Terraform/Vagrant native syntax) and Nix attribute sets, and emit Kubernetes ConfigMap or Secret manifests. Template placeholders (${VAR}, {{var}}, envsubst) are preserved verbatim, type inference provenance (string/int/float/bool/list) is tracked, HCL block labels fold into nested keys, and a round-trip diff calls out non-equivalent settings — dropped keys, re-typed values and rewrites — instead of coercing them silently.
- [OpenAPI to Postman Collection](https://elysiatools.com/en/tools/openapi-to-postman-collection): Turn an OpenAPI 3.x or Swagger 2.0 spec (JSON/YAML) into an importable Postman Collection v2.1.0 with folders, variables, auth and example responses.
- [YAML-JSON Converter](https://elysiatools.com/en/tools/yaml-json-converter): Convert between YAML and JSON formats
- [JSON Schema to Zod Schema Converter](https://elysiatools.com/en/tools/json-schema-to-zod-schema-converter): Convert JSON Schema JSON/YAML definitions into ready-to-use Zod schemas with nested objects, arrays, enums, and common validation rules
- [OpenAPI to TypeScript Generator](https://elysiatools.com/en/tools/openapi-to-typescript-generator): Convert OpenAPI or Swagger JSON/YAML specs into TypeScript API types, request payloads, and response models with configurable output and naming styles
- [WireGuard/OpenVPN to Clash and sing-box Config Bridge](https://elysiatools.com/en/tools/wireguard-openvpn-to-clash-singbox-bridge): Convert pasted WireGuard or OpenVPN client text into Mihomo/Clash YAML or sing-box JSON with secret-field diagnostics; do not share private keys

## Samples

- [OpenAPI/Swagger Samples](https://elysiatools.com/en/samples/openapi-swagger): Comprehensive API documentation examples using OpenAPI 3.0 and Swagger specifications for RESTful services
- [Parcel Bundler Samples](https://elysiatools.com/en/samples/parcel): Parcel zero-configuration bundler examples including project setup, plugins, and advanced configuration
- [Distributed Tracing Samples](https://elysiatools.com/en/samples/distributed-tracing-samples): Comprehensive distributed tracing examples using Jaeger, OpenTelemetry, and other modern observability tools for microservices architecture
- [pnpm Package Manager Samples](https://elysiatools.com/en/samples/pnpm): Fast, disk space efficient package manager examples including monorepo management, workspace configuration, and advanced workflows
