Compare two JSON documents. See changed lines in a visual diff or inspect each changed field by its path.
Object key order and formatting are ignored. Arrays are compared by position. Number spelling matters: 1 and 1.0 differ.
Try an example:
0 / 200,000 UTF-16 units
0 / 200,000 UTF-16 units
Up to 200,000 UTF-16 units and 10,000 values per input, 64 nesting levels, 500 differences. Duplicate keys are rejected. Ctrl/⌘ + Enter compares.
How to compare JSON
Paste both documents
Put one JSON document in each box, or choose an example to try the tool. Objects, arrays and single JSON values are accepted.
Choose Compare JSON
Invalid input stays in its box, with a message identifying the side and location to fix. Editing either input clears the previous result.
Inspect the differences
JSON diff shows aligned lines, with side-by-side and unified layouts. Choose word, character or whole-line highlighting and expand unchanged sections for context. Field changes lists each changed path and both values.
Copy the report
Copy full report includes every difference, even when the field list is filtered or some visual lines are folded. If automatic copying fails, select the report shown for manual copying.
What counts as a difference?
Object keys and strings
Object key order and whitespace outside strings are ignored. Equivalent JSON string escapes match, but whitespace inside strings, letter case and different Unicode spellings remain significant.
Arrays
Items are compared by their zero-based position. Order and duplicate occurrences matter; objects are not automatically matched by an id field.
Numbers and types
Numbers are compared exactly as written, without rounding them to JavaScript numbers. This also means 1, 1.0 and 1e0 differ. A number and a quoted string are different types.
Missing fields and duplicate keys
A missing field differs from a field whose value is null. Duplicate object keys are rejected, including keys written with different escapes that decode to the same name.
Limits
Each input supports 200,000 UTF-16 units, 10,000 values and 64 nesting levels. A comparison can report up to 500 differences. Larger comparisons are refused without changing the inputs or presenting an incomplete result as a match.
Large visual results
The visual view has a separate display limit. When it is exceeded, Field changes and the complete report remain available. Detailed highlighting may fall back to whole lines; the view tells you when that happens.
Why can inserting one array item create several differences?
Arrays are matched by position. Comparing [1,2,3] with [0,1,2,3] changes positions 0, 1 and 2 and adds position 3. The tool does not infer that the existing items moved.
Is the copied report a JSON Patch?
No. It is a text report with JSON Pointer paths, types and values from both inputs. It is intended for review, not for automatically modifying another document.
Where does the comparison run?
Parsing and comparison run in your browser. This tool does not save your drafts or fetch JSON from a URL. Keep a copy of important input before leaving the page.