YAML Diff — Structural Compare of Two YAML Documents
Compare two YAML documents structurally by parsing both first. Ignores irrelevant format differences (quote style, comments, indentation) — you see only what actually changed. Handles multi-document YAML. 100% local.
Last updated:
Comments| Change | Path | Left | Right |
|---|---|---|---|
| Changed | $.replicas | 2 | 3 |
| Changed | $.image | "web-app:1.4.2" | "web-app:1.5.0" |
| Changed | $.env.LOG_LEVEL | "info" | "debug" |
| Added | $.env.FEATURE_FLAG_X | — | true |
| Added | $.ports[1] | — | 9090 |
Frequently Asked Questions
How is a YAML diff different from a git diff?
git diff is line-based, so re-indenting or reordering keys shows as a large change even when the data is identical. This tool parses both sides as YAML first and compares them structurally — so 'name: web-app' followed by 'replicas: 2' vs the reverse order counts as unchanged, and a real data change (replicas 2 → 3) shows up as one clean entry.
Does it support multi-document YAML (--- separators)?
Yes. Both sides are parsed with js-yaml's loadAll. Multiple documents become an array on that side, so the diff will show per-document differences. Single-document files stay as scalar values / maps for a cleaner path.
What about YAML anchors and aliases?
js-yaml resolves anchors and aliases before we compare, so &name / *name references are diffed as their expanded values. That means the same data expressed with or without anchors will compare as identical.
Related Tools
JSON → TypeScript
Convert JSON to TypeScript interfaces instantly. Generate strongly-typed TS types from any JSON sample.
JSON → Go
Convert JSON to Go structs online. Generates idiomatic Go structs with proper json tags and PascalCase field names.
JSON → Python
Convert JSON to Python @dataclass definitions with typed fields. snake_case field names, nested classes, List[T] for arrays, and JSON-key alias comments. 100% local.
JSON → PHP
Convert JSON to PHP 7.4+ classes with typed properties. Generates one class per nested object, phpdoc @var array<T> for typed arrays, and camelCase property names. 100% local.
JSON → Java
Convert JSON to Java POJOs with Jackson @JsonProperty annotations, camelCase field names, List<T> for arrays, and generated getters/setters. Optional package declaration. 100% local.
JSON → C#
Convert JSON to C# classes with System.Text.Json [JsonPropertyName] attributes, PascalCase properties, List<T> for arrays, and optional namespace. Works in .NET 6 / 7 / 8 / 9. 100% local.