JSON Diff
Compare two JSON documents structurally and see exactly which paths were added, removed or changed. 100% free, no signup. Everything runs in your browser.
Loading the tool…
A line diff of two JSON files tells you that forty lines changed when one number did, because somebody's serialiser wrote the keys in a different order. I built this because the question when comparing two API responses, two config files or two exports is never "which lines differ" but "which values differ, and where". Paste the two documents, and the tool parses both, walks the trees together and reports every difference by its path: added, removed, changed, or changed type. Key order and whitespace are ignored entirely, because to the program reading the file they do not exist.
The type-change category is the one line diffs cannot give you and the one that causes the most bugs. A field that was the number 19.99 and is now the string "19.99" looks identical in a text diff and will break the first piece of code that does arithmetic on it. Here it is flagged separately with both types named. The comparison runs on your device, which matters because API responses and config files are exactly the kind of thing that contains keys and customer data. When the result needs tidying for a report, the JSON formatter does the pretty-printing, and when the two things to compare are plain text rather than JSON, the text compare tool is the right one.
How to use
- Paste the earlier or expected document on the left and the later or actual one on the right. The example button loads a pair that shows every kind of change.
- Read the four counts: added, removed, changed, and type changed.
- Scan the table. Each row is one path, with the value before and after.
- Use the filter buttons to show only one kind of change, which is useful when a large document has dozens of trivial changes and one type change.
- Press Copy list to put the differences on the clipboard as plain text for a ticket or a message.
- If either side will not parse, the error names the line and column.
Why use our json diff?
Structural, so reordering is not a change. Both documents are parsed and compared as trees. Two objects with the same keys and values in a different order are reported as identical, and a file reformatted from one line to pretty-printed is identical too. The JSON specification says object members are unordered, and a diff that disagrees with the specification is measuring the wrong thing.
Type changes get their own category. A number becoming a string, a null becoming an empty object, a boolean becoming the word true: each is reported with the type before and after. These are the changes that pass a visual check and fail in production, and most diff tools fold them in with ordinary value changes or miss them entirely.
Paths you can act on. Every difference is named like `$.stock.warehouse` or `$.tags[2]`, which is the form a developer can drop straight into a query, a test assertion or a bug report. Keys that are not plain identifiers are quoted, so a path is never ambiguous.
Honest about arrays. Arrays are compared by position. Remove the first element of a ten-item list and the tool reports nine changed values and one removal, because that is what the data says. A tool that guessed at insertions and deletions would be right sometimes and silently wrong the rest of the time, and for data that is going into a system, silently wrong is worse. The page says this where you will see it.
Runs on your device, with the error you need. Nothing is sent anywhere; the parse and the walk happen in the page. When a document fails to parse, the message gives the line and column rather than a generic failure, which on a 2,000-line export is the difference between fixing it and giving up. The XML to JSON converter is the step before this one when the source is XML.
Who is this tool for?
Comparing an API response against yesterday's. Save the response from a known-good run, paste today's beside it, and see exactly which fields moved. A changed type or a removed field is a breaking change the changelog may not have mentioned.
Reviewing a configuration change. Two versions of a config file, one from the environment that works and one from the environment that does not. The diff is usually one path long, and it is almost never the one the commit message pointed at.
Checking an export before import. A product feed, a user list, a translation file. Compare the new export with the previous one and confirm the differences are the ones expected before the import runs. The JSON to CSV converter turns either side into a spreadsheet for the people who need to sign off on it.
Writing a bug report that gets fixed. Expected on the left, actual on the right, Copy list, paste. A list of paths with before and after values is a report an engineer can act on without reproducing the request first.
Frequently asked questions
No. Objects are compared by key, not by position, so two documents with the same keys and values in different orders are reported as identical. The same applies to whitespace and formatting. This is the main reason to use a structural diff over a line diff for JSON.
By position: the first element against the first, the second against the second, and so on. An element removed from the middle of a list therefore shows as every later element having changed plus one removal at the end. The tool does not guess at insertions, because guessing wrong would hide real changes.
A value whose kind differs between the two documents: a number that became a string, a null that became an object, an array that became a single value. These are reported separately from ordinary changes because they are the ones that break code, and because they are invisible in a text diff where 19.99 and "19.99" sit on the same line.
No. Both documents are parsed and compared in your browser. Nothing is sent to a server, which is the right arrangement for API responses that contain tokens or customer records. The JSON formatter works the same way.
Usually a trailing comma, a single-quoted string, a comment, or an unquoted key, none of which JSON allows even though JavaScript does. The error names the line and column. Pasting the document into the JSON formatter will show the same error with the surrounding context.
The comparison itself handles documents of several megabytes. The result table stops at 5,000 differences and says so, since a list longer than that is not something anyone reads; narrow the comparison to the section that matters.
They are the route from the root to the value, in the same style as JSONPath: `$.name` for a top-level key, `$.stock.warehouse` for a nested one, `$.tags[2]` for the third element of an array. Keys with spaces or punctuation are written as `$["key name"]` so the path stays unambiguous.

