YAML Compare & Diff Online - Fast, Secure & Private
Updated
Compare and diff two YAML documents side-by-side. 100% client-side processing. Free online YAML comparison.
What it does with tricky input
Each row is an automated test: the tool's own code runs on the input before every release, and the release stops if the result changes. Error text is what Chrome prints; Firefox and Safari word some errors differently. More on how we test.
| Case | Input | Result |
|---|---|---|
| Two 19-digit IDs, one digit apart | InputLeft: id: 1798471297139281920Right: id: 1798471297139281921 | ResultYAML documents contain differences. [id]: 1798471297139281920 !== 1798471297139281921 |
| Same data, keys in another order | InputLeft: a: 1\nb: 2Right: b: 2\na: 1 | ResultYAML documents are identical (structure and values). |
| A flow list against a block list | InputLeft: tags: [x, y]Right: tags:\n - x\n - y | ResultYAML documents are identical (structure and values). |
| Single against double quotes | InputLeft: a: 'hi'Right: a: "hi" | ResultYAML documents are identical (structure and values). |
| A number against a quoted number | InputLeft: port: 80Right: port: "80" | ResultYAML documents contain differences. [port]: 80 !== "80" |
| An anchor against the same data written out | InputLeft: b: &x {k: 1}\nc: *xRight: b: {k: 1}\nc: {k: 1} | ResultYAML documents are identical (structure and values). |
| Several documents split by ---The path starts with the document number, from 0. | InputLeft: a: 1\n---\nb: 2Right: a: 1\n---\nb: 3 | ResultYAML documents contain differences. [1.b]: 2 !== 3 |
Key Features
- ✅ Instant YAML comparison and diff
- ✅ Real-time difference highlighting
- ✅ 100% client-side - your data never leaves your browser
How to Use
- Paste your two YAML documents into the editors
- Click "Compare"
- View differences highlighted instantly
Expert FAQ
- One file writes a value as port: 8080 and the other as port: "8080" (quoted) — does that register as a difference?
Yes, currently it would — this comparison doesn't parse YAML at all; it's a raw line-by-line text diff, so port: 8080 and port: "8080" are different lines of text and will show up as a difference even though they'd decode to the same value. - Does mapping key order matter — if I reorder keys in a Helm values.yaml without changing values, will it show a diff?
Currently, yes — this tool compares raw text lines, not parsed YAML, so reordering keys changes which line of text sits at which position and will show up as a difference even though the underlying mapping is unchanged. - Are anchors and aliases resolved before comparing, or compared as literal &name/*name text?
Compared as literal text — the documents aren't parsed for comparison purposes at all, so an anchor reference (*name) in one file and the same value spelled out literally in the other will show as a difference, even though they resolve to the same data. - What about a value present in one file but explicitly set to null in the other — same as missing, or different?
Different — an explicit key: null is reported as a value change relative to the key being absent entirely, even though many applications treat "unset" and "null" the same way at runtime. The diff reflects what's actually in the document, not how a particular consumer might interpret it, since collapsing that distinction would hide a real edit to the file.
Technical Details
This comparison works on the text of the two documents, line by line, and highlights the lines that differ. That is the right view for reviewing an edited config against its previous version, where the rest of the file keeps the same layout. Because it compares text rather than parsed data, stylistic changes count as differences: reordering keys, switching a value between quoted and unquoted, flow vs block style, or refactoring a repeated value into an anchor will all show up, even when the resolved data is identical. Keep formatting consistent on both sides (run both through the YAML Formatter) to keep the diff focused on real value changes.