JSON Compare
Compare two JSON documents and see structural differences as added, removed, or changed paths. The comparison runs in your browser and treats array positions as indexed paths.
What it does
JSON Compare is useful when checking API responses, configuration revisions, exported records, or test fixtures. It parses each document before comparing it, so malformed JSON is reported instead of being compared as plain text.
Objects are compared recursively by key. Arrays are compared by numeric position, which makes the result precise but means inserting one early array item may produce several downstream changes.
How to use this tool
- Paste both documents: Place the original JSON on the left and the version you want to compare on the right.
- Run the comparison: Select Compare JSON. Invalid input is identified before any difference list is produced.
- Review paths and values: Use the Added, Removed, and Changed groups to locate structural differences.
Input and output
Input
- Two JSON documents containing any valid JSON value, including objects, arrays, strings, numbers, booleans, or null.
Output
- A categorized list of added, removed, and changed paths with the relevant old or new values.
- An identical-result message when both parsed JSON values match.
How it works
Parse
Each input is parsed with the browser JSON parser, so JSON syntax and data types are preserved.
Walk recursively
The comparator visits object keys and array indexes, using paths to identify each location.
Classify differences
Missing keys become additions or removals; unequal primitive values and incompatible structures become changes.
Practical example
- Scenario
- Checking whether an API response changed
- Action
- Paste the two objects and select Compare JSON.
- Input
- Original: {"status":"pending","count":2}; Updated: {"status":"ready","count":2,"cached":true}
- Expected result
- The result marks status as changed and cached as added, while count is omitted because it matches.
Limitations
- Arrays are compared by index rather than by an ID field or as unordered sets.
- Object property order and insignificant whitespace do not count as differences after parsing.
- The tool does not generate a JSON Patch, merge documents, or download a report.
- Very large documents are limited by available browser memory and may make the page less responsive.
Frequently Asked Questions
Does property order affect the comparison?
No. Parsed object keys are compared by name, so changing only their written order does not create a difference.
How are arrays compared?
Array items are compared by zero-based position. Reordering or inserting items can therefore create multiple reported differences.
Can I compare invalid or commented JSON?
No. Both sides must be valid JSON; comments and trailing commas are rejected by the JSON parser.
Is my JSON uploaded?
No. This comparison is performed in your browser and the tool does not send the documents to a YesFreeTool processing endpoint.