Compare JSON & YAML
Find meaningful differences between JSON or YAML structures.
- Processed locally in your browser
- Your documents stay in your browser
- Nothing you enter is sent to a server
Processed locally
Both documents are read and compared in this browser tab. Nothing you enter is sent to a server.
Original
Auto-detected: JSON
Ready to compare.
Edit the text to fix this, open a different file, or clear this side and start again.
Up to 200 kB, as UTF-8 text.
Changed
Auto-detected: YAML
Ready to compare.
Edit the text to fix this, open a different file, or clear this side and start again.
Up to 200 kB, as UTF-8 text.
Checking this side…
Comparison result
No comparison yet
Add a document on each side, then choose Compare structures. The differences appear here.
| # | Change | Path | Original value | Changed value |
|---|
No differences of this kind.
How this comparison works
- Compares structure and values, not formatting.
- Key order in objects and mappings is ignored.
- Whitespace, indentation, quoting and YAML comments are ignored.
- Types stay significant: 1 and "1" are different.
- List order stays significant: items are matched by position.
- Numbers are compared by exact value: 1, 1.0 and 1e0 are equal.
Example
{
"name": "api",
"port": 3000,
"debug": false
}name: api
port: 8080
debug: falseThe format does not matter. Only $.port is reported, as Changed.
features:
- authfeatures:
- auth
- loggingThe new list item is reported as Added at $.features[1].
replicas: 3replicas: "3"A number and text with the same characters are reported as a Type change at $.replicas.
Important limitations
- Lists are compared by position. Nothing is matched by content, so moves and renames are not detected: a renamed key is one removal and one addition.
- A missing key and a key set to null are different.
- Differences are listed in path order, with keys in alphabetical order. They are not marked in your text.
- Each side is one document of up to 200 kB, 80,000 values and 200 levels, counting every value an alias stands for. Larger input is refused, never partly compared.
- YAML is read as data only, with at most 100 aliases per side. Merge keys, custom tags, several documents, keys that are not text and repeated keys are refused.
- A repeated key in JSON is refused too, because tools disagree about which value wins.
- Text that starts with { or [ and is not valid JSON is reported as invalid JSON. Open it as a .yaml or .yml file to read it as YAML.
