YAML Diff Comparator
Compare two YAML documents and see exactly what changed — added, removed and modified keys with a path to each one, plus a unified line diff of the normalized YAML. Structural comparison ignores indentation, quoting and flow-vs-block formatting, and handles multi-document streams. Runs entirely in your browser.
Input
Options
Use "ignoring order" when a list is really an unordered set and reshuffling it shouldn't count as a change.
Treat 1 and "1", or true and "true", as equal — useful when one file quotes its values and the other doesn't.
Output
| Metric | Value |
|---|---|
| No data yet | |
Every difference keyed by its path — + added, - removed, ~ changed.
Both documents re-serialized with 2-space indent first, so formatting differences don't create noise.
Guides
Paste two versions of a YAML file — a Kubernetes manifest before and after a change, two CI pipeline configs, a docker-compose.yml across environments — and see exactly what's different. This free online YAML diff comparator reads both documents as parsed YAML, not as plain text, so reindenting a block, quoting a value or switching from block to flow style never shows up as a change. You get a structural report keyed by the path to each difference, plus a normalized unified diff you can copy into a patch file. Everything runs in your browser, with no upload and no sign-up.
How to use it
- Paste the original file into YAML A and the modified one into YAML B.
- Choose how list items are compared — by position (the default, right for ordered lists like container args) or ignoring order (right for a list that's really a set, like tags or allowed hosts).
- Turn on Ignore type differences if one file quotes its values and the other doesn't, so
8080and"8080"compare as equal. - Read the Summary for counts, the Structural diff for a path-by-path list of what changed, and the Unified diff for a line-level view.
The output updates automatically as you type.
How does the structural diff decide what changed?
Both files are parsed, then the two resulting values are walked together. At every mapping it reports keys present on only one side (added or removed) and recurses into keys present on both; at every sequence it compares item by item; at every scalar it compares the value. Each entry is prefixed with + (added), - (removed) or ~ (changed) and a dotted path like spec.template.spec.containers[0].image, so you can jump straight to the line that matters in a 400-line manifest.
Why is a "structural" diff better than a plain text diff?
Because most YAML text differences aren't real differences. ports: [80, 443] and a two-line block sequence are the same data; so are name: app and "name": app; so is the same file re-indented from 4 spaces to 2. A line diff reports all of those. This tool reports none of them — only changes that would actually reach whatever consumes the file.
Then why is there also a unified diff?
Because a line-level view is what you paste into a patch or a code review. To keep it useful, both files are first re-serialized from their parsed form at a fixed 2-space indent, and that normalized text is diffed — so the patch shows real edits rather than formatting churn.
Does it handle multi-document files?
Yes. --- separated streams are compared document by document in order, and paths are prefixed doc[2].… so you can tell which document a difference belongs to. Extra documents on either side are reported as added or removed.
What about comments?
Comments are not compared. They carry no meaning to anything that reads the data, and both views are computed from the parsed documents, which don't retain them.
Is my data private?
Completely. Parsing and diffing happen entirely in your browser — neither file is uploaded, logged or stored, which matters when the YAML you're comparing is a production manifest.
Need something other than a YAML diff?
To compare JSON instead, use the JSON Compare tool; for XML, use the XML Diff Comparator. If one of your files won't parse, the YAML Validator will point at the syntax error.