Developer
JSON Compare Online
Spot what changed between two JSON documents, down to the property that moved, so an API response or a config edit is quick to review before you ship.
Structural diff
Provide JSON in both panes to compare.
Output actions
Ready to copy output once your result appears.
Paths for objects, indexes for arrays
JSON Compare Online reads JSON A and JSON B and writes Structural diff as you edit either pane. Ignore array order starts unchecked. There is no Compare button. Load sample fills a price object at 10 on the left and 12 on the right. Reset clears both panes. A pane that is empty or only whitespace says Provide JSON in both panes to compare. Copy output and Download output use the diff text. The download file is json-compare.txt. Each pane is limited to 1 MB characters.
How to compare two JSON values
- 1Paste into JSON A and JSON B, or press Load sample. The placeholders are a key of value and a key of updated. Both panes have to hold JSON.
- 2Read Structural diff. A line that starts with + was added on the right, a line that starts with - was only on the left, and a line that starts with ~ changed. Leave Ignore array order off to compare arrays by index.
- 3Turn on Ignore array order when the sequence does not matter and duplicate counts still should. The diff updates immediately. Reset clears both panes. Copy or download the lines you see.
What it is good for
- • Reviewing an API body where one field changed and the other fields should stay quiet.
- • Confirming that reordering object keys is not a difference.
- • Catching a duplicated array element that a set comparison would hide.
Example
Input
JSON A: {"price":10,"active":true}
JSON B: {"price":12,"active":true}Output
~ price: 10 => 12
Press Load sample. active is on both sides, so it is not listed. Swapping the key order of either object still produces this one line. Ignore array order does not change this sample, because neither value is an array.
What a diff line means
Both panes are parsed as JSON. Object keys are matched by name, so {"b":1,"a":2} against {"a":2,"b":1} prints No structural differences found. A key only on the right is a plus line with the right-hand value. A key only on the left is a minus line with the left-hand value. A key on both sides whose values differ is a tilde, the left value, =>, and the right value. The sample is ~ price: 10 => 12. Nested objects use a dotted path when the key is an identifier. price under offer is offer.price. A key that is not an identifier, such as a.b as one key, is shown as $["a.b"].
Arrays are compared by index unless Ignore array order is on. [1, 2] against [2, 1] is ~ ids[0]: 1 => 2 and ~ ids[1]: 2 => 1 when the array sits on ids. An added index is a plus. A missing property is not null. Adding "a": null is + a: null. Removing a key whose value was null is - a: null. Changing an object to an array is one tilde at that path, {} => []. A number against the same digits in quotes is a tilde, 1 => "1". The root path, when the two top-level values differ and are not both containers of the same kind, is $. Identical values, including two empty objects, produce No structural differences found.
Ignore array order and the two panes
Ignore array order starts unchecked and updates the diff as soon as you toggle it. Checked, an array is compared as a multiset of its items, nested objects included, and duplicate counts stay. [1, 1, 2] against [2, 1, 1] is not a difference. [1, 1, 2] against [2, 1] is one tilde at the array path, ~ ids: [1,1,2] => [2,1], rather than a set of index lines that pretend the items lined up. Children of that array are not listed separately once the array itself is reported. Object key order is ignored either way. The checkbox does not sort your input. It only changes the comparison.
There is no button between the panes and the diff. Clearing one pane, or leaving it as spaces, replaces the diff with Provide JSON in both panes to compare. Invalid JSON replaces it with Invalid JSON in one or both panes. Validate and try again. and the parser message. A pane longer than 1,000,000 characters uses that same error line and the limit sentence. Load sample writes the price pair and shows the one tilde as soon as both sides are set. Reset clears both boxes. The copied text is the diff, including the no-difference sentence when that is what the panes produced. The download file is json-compare.txt.
When a property path is the review you want
Use the panes when the identity of a change is the key or the index, not the character column where it happened to sit. An API response with an added field, a config object with a changed number, or two fixtures that should match except for one path all fit. A line-oriented edit, such as a README or a pair of env files, is easier in the text diff viewer, which marks rows rather than property paths. Pretty-printing either side first is the JSON formatter. This page does not indent the inputs.
Turning the objects into rows is JSON to CSV. The request guide is about reading a browser call as code, which is a separate step from diffing two bodies you already captured. This page does not fetch either document. Paste both. It also does not decide which side is newer. The left pane is the left value and the right pane is the right value, and the arrows point left to right.
Duplicates, null, and numbers that are strings
Duplicate counts are part of the unordered comparison. Dropping one of two identical ids is a change even when Ignore array order is on, and the line shows both arrays. Order-sensitive mode would instead report index changes that may be only a shuffle. Pick the mode that matches the contract. A missing key and a key set to null stay different, including when the null is nested. An empty array and a missing array stay different. An empty object and an empty array stay different.
JSON numbers are JavaScript numbers. An integer wider than the safe range can already have been rounded by the time the diff runs, so two ids that differed only past that range can look equal. Keep those ids in strings. Two strings are compared exactly, so a trailing space is a change. Duplicate keys in one object collapse when the pane is parsed, and the last value is the one that is compared. Comments and trailing commas are invalid and clear the diff into the error sentence. The page will not repair them. Split a huge document and compare the section you care about if the browser slows down. The limit is per pane.
Comparison rules
Object keys match by name. + was added on the right, - was only on the left, ~ changed. Paths are dotted for identifier keys, bracketed for other keys, and indexed for arrays. The root is $ when a top-level scalar or a container type changes.
Arrays compare by index until Ignore array order is on. That mode keeps duplicate counts and reports a changed array at the array path. Missing is not null. Each pane allows 1,000,000 characters. The diff updates as you type. Copy and download are the diff text.
Common problems
If a shuffle of the same items filled the diff, Ignore array order is off. Turn it on. If a duplicate disappeared and the diff stayed quiet, the counts really match. [1, 1, 2] against [2, 1] does not.
If both panes look like JSON and the line says Invalid JSON, look for a trailing comma, a comment, or single quotes. If a huge integer matched unexpectedly, it was parsed as a JavaScript number. Quote it.
Frequently asked questions
Does object-key order matter?
No. Keys are matched by name. Reordering the keys in either object does not add a diff line.
Does array order matter?
Yes, until you check Ignore array order. That mode compares items as a multiset and still treats a missing duplicate as a change.
Is a missing property the same as null?
No. A key present on only one side is a plus or a minus. A key whose value is null is a real value, so removing it is a minus of null.
Can I compare a number with a string?
Yes. 1 against "1" is a tilde at that path. The page does not coerce types to force a match.
Is my input uploaded or saved?
This tool processes input in your browser and does not save its input or output to local storage. Copy and download are user actions. The site uses analytics for page and action metadata and may use ads and production error reporting; see the Privacy Policy for those services.
About this tool
Maintained by Toolbench. For large or deeply nested files, split the input into smaller batches and verify representative results before using them in an import or application. Report reproducible problems through Contact.
Guides
- Turn a browser request into Python or JavaScript
Capture one request as cURL, convert it to requests or fetch, and review credentials and browser restrictions.
Next steps
Related tools
Continue the workflow with nearby tools for formatting, publishing, debugging, or follow-up checks.
JSON Formatter
Pretty-print JSON with 2 or 4 spaces, or minify it.
Open JSON FormatterText Diff Viewer
Compare two text blocks line by line, by row index.
Open Text Diff ViewerJSON to CSV
Convert a JSON array of objects to CSV.
Open JSON to CSVJSON Schema Generator
Infer a JSON Schema from example JSON, including required fields.
Open JSON Schema GeneratorTrust
Policies, contact, and answers
Clear pages for how Toolbench works, what we collect, and how to reach us.