JSON Diff: Compare Two JSON Documents Online
Paste two JSON documents side by side and see exactly what changed: added, removed, or modified values, each with its full path. Nothing is uploaded, so it is safe for real API responses and config files.
How to compare JSON
- The Diff tab is open for you. The left panel is pre-filled with whatever is in the editor, and you can overwrite it.
- Paste the second document into the right panel.
- Click Compare.
Both sides must be valid JSON. If one is not, you are told which side has the problem. Use the JSON validator to find the error.
Reading the results
Each difference is one line, with the path from the root ($) to the value:
- + added (green): the key exists only in the right document.
- - removed (red): the key exists only in the left document.
- ~ changed (yellow): the value differs, shown as old value → new value. A change of type, such as a string becoming a number, is reported as a change.
Paths look like $.user.address.city. Array items are addressed by index, such as $.items.2.price, so inserting an item near the start of an array shifts the indexes after it. Objects are compared by key, so the order of keys does not matter. If the documents match, you see "Documents are identical".
What to use it for
- Compare an API response between staging and production.
- Check what changed in a configuration file before you deploy.
- Review a data export against last week's export.
- Confirm that a refactor still returns the same payload.
Tips for cleaner comparisons
Run both documents through Format first so they are easy to read alongside the results, and use Sort Keys if you want to eyeball them in the same order. For a broader tour of the tool, see the JSON formatter and viewer.
More JSON tools
- Format JSON: formatter, validator, tree viewer and diff.
- JSON Prettier: pretty print JSON and repair invalid JSON.
- JSON Validator: check JSON syntax and find errors.
- JSON to CSV: convert JSON to CSV (and CSV back to JSON).
- JSON to YAML: convert JSON to YAML.
- JSON Minifier: minify JSON and remove whitespace.
- JWT Decoder: decode and inspect JSON Web Tokens.
- Common JSON Errors: causes and fixes for invalid JSON.
Frequently asked questions
How do I compare two JSON files?
Open the Diff tab, paste one document on each side, and click Compare. Differences are listed with their paths.
Does key order matter?
No. Objects are compared key by key, so the same data in a different key order is reported as identical.
How are arrays compared?
By position. Item 0 is compared with item 0, item 1 with item 1, and so on, so inserting an item early in an array shows later items as changed.
Can I compare files instead of pasting?
Load a file into the editor and it fills the left side of the diff. For the right side, paste the contents.
Is my data uploaded?
No. The comparison runs in your browser and nothing is sent to a server.