YAML Diff & Compare
Compare two YAML documents semantically with changed lines highlighted, merge keys resolved, and multi-document streams aligned.
Comparison options
Comments, quote style, block vs flow formatting, and mapping key order never count as changes. Anchors and merge keys (<<: *defaults) are expanded, multi-document streams (---) are aligned per document, and 64-bit integers stay exact.
Paste two YAML documents, open two files, or load the example. To check one document for syntax errors first, use the YAML validator.
How to Diff Two YAML Files
Paste or open the original YAML on the left and the modified YAML on the right. Syntax errors are highlighted with their exact line and column, and duplicate mapping keys are surfaced as warnings. When both sides parse, changed lines are highlighted directly in both editors and every difference is listed by path below so you can step through changes with Prev/Next or copy a plain-text diff report.
Semantic Rules Applied
YAML gives authors several ways to write the exact same data. This comparator normalizes syntax differences while preserving value fidelity.
| Input | Output | Note |
|---|---|---|
| a: 1, b: 2 vs b: 2, a: 1 | Equivalent | Mapping key order is ignored |
| 'hello' vs "hello" vs hello | Equivalent | Quote style is ignored |
| <<: *defaults vs expanded keys | Equivalent | Anchors and merge keys resolved |
| id: 9007199254740993 vs ...992 | Changed at $.id | Exact BigInt comparison |
| a: 1\n---\nb: 2 vs b: 3 | Changed at Doc 2 $.b | Multi-document streams supported |
Common Use Cases
Compare staging and production Kubernetes manifests, review Helm values overrides, audit Docker Compose service changes, diff GitHub Actions or GitLab CI workflows, and inspect OpenAPI YAML revisions before merging.
Frequently Asked Questions
Why use a semantic YAML diff instead of git diff?
A line-based text diff flags reordered mapping keys, quote style changes ("info" vs 'info' vs info), flow vs block collections, and added comments—even when the parsed configuration is identical. A semantic YAML diff parses both files under YAML 1.2 rules and reports only values that actually changed, added, or disappeared.
Does it handle YAML anchors, aliases, and merge keys (<<: *defaults)?
Yes. Anchors and merge keys are resolved before comparison. If one file uses a <<: *defaults block and the other writes the inherited keys explicitly with the same final values, the tool recognizes them as equivalent.
Can it compare multi-document YAML files separated by ---?
Yes. Kubernetes manifests, Helm outputs, and CI templates often bundle multiple documents in one file separated by ---. Each document is aligned in order and differences are labeled Doc 1, Doc 2, and so on.
Are large 64-bit integers compared safely?
Yes. Integers are parsed as exact BigInts rather than JavaScript floating-point numbers, so two 19-digit account or snowflake IDs that differ only in the last digit are reported as changed instead of falsely matching.
Do my YAML secrets or Kubernetes configs leave my browser?
No. Everything runs locally in your browser tab. No YAML content is uploaded to a server or stored in a URL.
Continue with the data, not the directory
Validate, format, repair, compare, query, and reshape payloads before they ship.
YAML Validator
Validate YAML with exact line and column errors, plus the warnings a pass/fail check hides.
YAML Formatter
Normalize YAML indentation and spacing while keeping your comments intact.
JSON Compare & Diff
Compare two JSON documents side by side, with changed lines highlighted, counts of what was added, removed and changed, and an option to ignore array order.
YAML to JSON Converter
Convert YAML, including multi-document files and merge keys, to JSON. Values JSON cannot hold are reported by path, never rewritten.