Free tool
YAML diff.
Staging values against production, a Helm chart before and after an upgrade, two workflow files — and a text diff full of moved keys, edited comments and quotes that changed style. This compares what the YAML means: every key that was added, removed or changed, with anchors expanded and list items matched by name.
Differences
| Change | Path | Before | After |
|---|---|---|---|
| Changed | $.defaults.retries | 3 | 5 |
| Changed | $.image.tag | "2.13.0" | "2.14.0" |
| Changed | $.replicaCount | 2 | 6 |
| Changed | $.env[name="FEATURE_KLARNA"].value | "off" | "on" |
| Changed | $.probes.liveness.retries | 3 | 5 |
Turns the change list into a link for whoever has to sign off on the config change — they comment on the exact path they are questioning, and the patch rides along. Free, no card.
Why a line diff gets YAML wrong
YAML gives you many ways to write the same data. Keys can come in any order, a list can be a block of dashes or [a, b] on one line, a string can be bare, single-quoted or double-quoted, and an anchor can stand in for a block written elsewhere. A line differ sees every one of those as a change. In the sample above the production file reorders its keys, rewrites image as a flow mapping, switches quote style and reorders env — and the only differences reported are the five a deployment would actually feel: the image tag, the replica count, the Klarna flag and the retry default, which shows up both where it is anchored and in the probe that merges it. For plain text or markup, the HTML diff is the right tool.
What it reports
- Every difference as a path —
$.replicaCountchanged from 2 to 6,$.image.tagfrom 2.13.0 to 2.14.0 — in JSONPath notation, so it reads the same as the JSON diff. - Lists of named items — Kubernetes
env,containers,ports, GitHub Actionsstepswith aname— matched by that name, so a reorder is not a change. - Type changes —
8080becoming"8080"is reported, because the program reading the file sees a string instead of a number. - The whole difference as a JSON Patch, the format
kubectl patch --type=jsonapplies.
Get the config change signed off
Production config changes usually need a second pair of eyes from someone who will not open a pull request. Publish the change list on Comma and send the link: the reviewer comments on the exact key they are asking about, the sign-off is recorded on the report, and a coding agent can read the comments back over the MCP server and adjust the values. To read the file as JSON first, use YAML to JSON.
Questions
- How do I compare two YAML files?
- Paste one file into each pane, or drop a .yaml or .yml file onto either side. Both are parsed and compared as data, so you get a list of every key that was added, removed or changed, with the old and new value side by side. Comments, indentation, key order and quoting style are ignored.
- Why not just use a text diff?
- Because most of what changes in a YAML file's text is not a change in its data. Reordered keys, a comment edit, 'single' versus "double" quotes, a block list rewritten as [a, b] on one line, an anchor expanded by hand — a line diff flags all of it. Comparing the parsed values reports only what a program reading the file would actually see differently.
- Are anchors, aliases and merge keys expanded?
- Yes. *alias references are replaced by the anchored value and <<: *defaults merge keys are merged into the mapping before comparing, so a file that uses anchors and one that spells the same values out in full compare as identical — and a change to the anchored default shows up at every place that inherits it.
- How are lists compared, like Kubernetes env or containers?
- If every item in both lists has a unique id-like field (name, id, key, slug, uuid or code), items are matched by it — so env vars or containers listed in a different order report only what really changed, labelled like $.env[name="FEATURE_KLARNA"]. Without one, items are aligned like lines in a text diff. Turn off “Match list items by name/id” to compare position by position.
- Is no / yes / on / off a boolean?
- Not here. The comparison reads YAML 1.2, where only true and false are booleans, so a country code of NO stays the string "NO", and off compares equal to "off". Some parsers still follow YAML 1.1 and read yes/no/on/off as booleans — if yours does, quote those values; a change from "off" to false is reported as a type change either way.
- Does it handle multi-document files (---)?
- Yes. A file with several documents separated by --- is read as a list with one item per document, and the documents are aligned the way a line diff aligns lines — so adding a Service between a Deployment and an Ingress reports one added document, not two changed ones.
- What is the JSON Patch tab?
- The same difference as an RFC 6902 JSON Patch — add, remove and replace operations with JSON Pointer paths. kubectl patch --type=json takes exactly this format, so the patch tab is the change you would apply to turn the left manifest into the right one.
- Is my YAML uploaded anywhere?
- No. Both sides are parsed and compared in your browser. They only leave your machine if you click “Publish this diff” and create a report.
Related: JSON diff · Cron explainer · HTML diff · YAML to JSON · What is JSON Patch? · all free tools