DevKits

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
129 chars · 10 lines
162 chars · 12 lines
Added2Removed0Changed3Type changed0Unchanged3
ChangePathLeftRight
Changed$.replicas23
Changed$.image"web-app:1.4.2""web-app:1.5.0"
Changed$.env.LOG_LEVEL"info""debug"
Added$.env.FEATURE_FLAG_Xtrue
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