Diff Checker
Paste two versions of a JSON or YAML file and see what really changed in the data. Indentation, spacing and key order don't count, and every changed value is listed by its path. Nothing is uploaded.
CHANGED PATHS
Loading the comparison…
LINE DIFF (NORMALISED)
Loading the comparison…
Why a normal diff shows too much
A text diff compares characters. Run a JSON file through a formatter, or let a tool save it with the keys in another order, and a text diff marks nearly every line as changed, even though the data is the same. The Diff checker first reads both files as data and writes them out the same way, with the same indentation and quotes, so only real changes are left.
Reading the changed paths
Each line starts with a sign: + for a value that was added, - for one that was removed and ~ for one that changed, followed by its path. Object keys are joined with dots, as in server.port, list items have their position in brackets, as in items[2] (counting from 0), and keys with spaces, dots or slashes are quoted, as in labels["app.kubernetes.io/name"]. Long values are cut short in the list; the line diff below shows them in full.
Numbers and types
Values are compared by their meaning, not their spelling: 1.0 and 1 are the same number, and "Paris" and 'Paris' are the same YAML string. A change of type does count, so "8080" (a string) and 8080 (a number) are listed as a change, because most programs treat them differently.
How to compare two JSON or YAML files
- 1
Pick the format and paste both versions
Choose JSON, YAML or plain text, then paste the original on the left and the changed version on the right. If one side can't be read, its error shows under it with the line and column.
- 2
Choose what counts as a change
Turn on Sort keys when the order of keys doesn't matter, and Ignore array order when lists may come in any order, such as tags or permissions. Both are off at first.
- 3
Read the changes
The changed paths list each value that was added, removed or changed, like user.address.city going from Paris to Lyon. Below it, the line diff shows both documents written out the same way, with the changed lines in red and green.
Frequently asked questions
When should I use the Diff checker and when Text compare?
Use the Diff checker for JSON and YAML, such as API responses, config files and package manifests. It compares the data, so a file that was only reformatted or had its keys reordered shows no changes. Use Text compare for prose, code and anything else, where every character counts and you may want to compare word by word.
What does Sort keys do?
It writes the keys of every object in A–Z order on both sides before the line diff, so two files with the same keys in a different order line up. The changed paths list never counts key order, with or without this option, because a JSON object has no order.
What does Ignore array order do?
It treats every list as a set of items, so ["a", "b"] and ["b", "a"] are the same. An item that's only on one side is listed as added or removed, with its position in that side. Leave it off when order matters, such as steps in a pipeline.
Can I compare JSON with YAML?
Not directly, because both sides use the same format. Convert one side first with the YAML to JSON converter, then compare them as JSON. Anchors and aliases in YAML are resolved before comparing, so a file that uses them matches one that writes everything out.
Are my files uploaded?
No. Both documents are parsed and compared in your browser, so API keys, tokens and other secrets in a config file stay on your device.