YAML Diff
Compare two YAML files in your browser. Both sides are parsed with js-yaml, re-emitted with sorted keys (optional), and line-diffed.
Structural compare for YAML
With normalize on, indentation and key order vanish from the output — leaving only the actual value changes.
name: hcodx version: 1 tags: - dev - tools
name: hcodx
+ owner: alice
tags:
- dev
- tools
+ - cli
- version: 1
+ version: 2What you'll use this for
YAML drives most modern infra — diffing two versions cleanly is essential.
Kubernetes manifest review
Diff two Deployment, Service, or ConfigMap manifests before applying.
GitHub Actions changes
Compare two versions of a workflow file to debug CI changes.
Config diff
Spot environment drift across prod/staging/dev YAML configs.
Helm chart compare
Review values.yaml changes between chart releases.
How to diff YAML structurally
Paste before
Drop the original YAML into the left editor. Tabs are not YAML — use spaces.
Paste after
Drop the modified YAML into the right editor.
Keep normalize on
Both sides parse via js-yaml, sort keys, and re-emit with 2-space indent.
Copy or download
Save as yaml.diff or paste into your code review.
Frequently asked questions
Both sides are parsed with js-yaml into JavaScript values, keys are sorted alphabetically at every level, and the result is re-emitted with 2-space indentation. The line diff then operates on the canonical form, ignoring whitespace and key-order noise.
The diff parses the first document only by default (yaml.load). Split multi-document YAML on --- and diff each one separately for clearer results.
Yes. Completely free, no signup, no limits. Both documents stay in your browser.
The parser surfaces the error inline in the diff output. Either fix it, or turn off normalize to fall back to a raw text diff. The YAML Validator shows line/column info for parse errors.
Click the swap arrows in the After header — it flips the two sides and re-runs the diff so additions and deletions switch roles.
About structural YAML diffing
A line diff over raw YAML gets noisy fast — reformatting, comment shuffles, or key reorders all show as changes even when the data is identical. Structural diff normalizes both sides through a real YAML parser first, then diffs the canonical form.
How normalization works
- Both inputs are parsed with
jsyaml.load. - Object keys are recursively sorted alphabetically.
- Both sides are re-emitted with
jsyaml.dump(value, { indent: 2, noRefs: true }). - The two normalized strings feed the line-based LCS diff.
Limits
- Comments are dropped — js-yaml's
dumpdoesn't round-trip them. - Anchors and aliases are resolved (
noRefs: true) so they don't fool the diff. - Tags and explicit YAML types may be normalized to their JS equivalents.