Skip to content
Tools

JSON Diff

See exactly what changed between two JSON documents, in the unified format Git prints. Structural, so formatting and key order never count.

Visible pane
Diff layout

Paste or upload two JSON documents to see what changed between them.

Left:Empty

Right:Empty

Everything happens locally in your browser. Your JSON is never uploaded.

What is a JSON diff?

A JSON diff shows what changed between two JSON documents. Not what changed in the text — what changed in the data. The two documents are parsed first, then walked in parallel, so a file that was reformatted, re-indented or had its keys sorted produces no changes at all.

That is the difference between this and a plain text diff. Run diff on two JSON files and a single reformat lights up every line. A structural diff ignores everything JSON considers meaningless — whitespace, indentation, key order, the choice between 1.0 and 1 — and reports only what a program reading the file would actually see differently.

One line changed, and only one line is reported
--- before.json+++ after.json {   "plan": "pro",-  "seats": 5,+  "seats": 12,   "active": true }

Everything runs in your browser. The documents people diff are usually API responses, config files and database records — exactly the things that should not be pasted into someone else’s server — so nothing here is uploaded, stored or logged.

How to use JSON Diff

  1. 1. Add the two documents. Paste one into each panel, drag a .jsonfile onto either of them, or use the upload button. The file name becomes that side’s label and appears in any report you export.
  2. 2. Read the diff. It runs as you type. The default is the unified view — one merged document with and + in the margin. Switch to Side by side for two aligned columns, or Changes for a list of just the differences with both values.
  3. 3. Step through the changes. The previous and next buttons in the result header move one change at a time and scroll it into view. The counter beside them tells you where you are.
  4. 4. Narrow it down. Open the options to hide additions, removals or modifications, or to limit the diff to array elements or object properties. The header always reports how many of the total changes are currently shown.
  5. 5. Tune the comparison.Ignore case, ignore whitespace inside strings, or ignore array order when a list’s order carries no meaning. Switch to structure mode to compare shape and types only.
  6. 6. Take it with you. Copy any JSON path with one click, or export the whole diff as a JSON report, a unified .diff file, or a self-contained HTML page you can attach to a ticket.

JSON Diff vs JSON Compare

This tool and JSON Compare use the same comparison engine and will always agree on what changed. They differ in how the answer is presented, and that difference decides which one you want.

JSON Diff

One merged document, in the format Git prints.

  • Unified view with − and + markers and a line number for each side
  • Runs of identical lines fold away, leaving a note of how many were hidden
  • Filters by change type, and by arrays or objects only
  • A changes-only list showing the before and after value together
  • Exports as a JSON report, a unified .diff file, or a standalone HTML page

Reach for it when the diff is going somewhere else — a pull request, a ticket, a changelog, an incident report.

JSON Compare

Two documents in two aligned columns.

  • Both documents in full, with matching rows lined up across the gutter
  • Expand and collapse branches to explore the structure at your own pace
  • Search across both sides, by key or by value
  • Show only the differences, or everything with the differences marked

Reach for it when you are reading the two documents themselves and want to see each change in the context of everything around it.

In short: Compare is for reading, Diff is for reporting. If you are not sure, start here — the side-by-side view is built into this tool too, so you can switch to it without leaving the page and without re-pasting anything.

Reading a unified diff

The unified format is what git diff, GitHub and virtually every code review tool print, which makes it the most widely readable way to describe a change. There is one merged document, and each line carries a marker in the left margin.

A modification, an addition and a folded run of identical lines
--- before.json+++ after.json {   "id": "sub_1042",-  "plan": "starter",+  "plan": "pro",+  "trial": false,@@ ⋯ 6 unchanged entries @@ }

The two narrow columns on the left are line numbers: the first counts lines in the original document, the second counts them in the new one. A removed line has no number in the second column because it does not exist there, and an added line has none in the first. That is why the two columns drift apart as you scroll — the gap between them is the size of the change.

A modified value appears as a removal immediately followed by an addition, because “change” is not a thing the format has a marker for. Lines with a blank marker are context: identical in both documents, shown so the change makes sense. With Collapse unchanged on, long runs of context fold into a @@ ⋯ n unchanged entries @@ marker so the changes are not buried.

The four kinds of change

Every difference the tool reports is one of these. The summary counts them separately, and the filters switch them on and off.

AddedThe key or element exists in the second document and not the first. A whole added object expands to every one of its lines, so you can see exactly what arrived rather than just that something did.
RemovedThe key or element exists in the first document and not the second. In an API response this is the change most likely to break a consumer, because clients tend to assume a field that has always been there always will be.
ModifiedThe key exists on both sides but the values differ. In the unified view a modification renders the way Git renders one: the old line marked −, immediately followed by the new line marked +.
Type changedA modification where the JSON type itself changed — a number became a string, an object became an array, a value became null. These are flagged separately because they break parsing code that a mere value change would not.

When you need a JSON diff

Reviewing an API change

Capture a response before and after a deploy and diff the two. Formatting and key order are ignored, so what is left is exactly the contract change — including the removed field nobody mentioned in the changelog.

Debugging a failing test

Paste the expected payload and the actual one. The changes list gives you the JSON path of every mismatch, ready to paste straight into an assertion.

Auditing a config change

Diff last week's configuration against today's. Turn off Added and Modified to see only what was deleted — usually the most interesting question when something has stopped working.

Writing a migration

Diff a record in the old schema against the same record in the new one, then export the JSON report as a checklist of every field the migration has to account for.

Comparing environments

Staging returns one thing and production another. A diff of the two responses shows the drift in seconds, and the HTML report attaches to the incident ticket.

Reviewing a lockfile or a translation bundle

Files that are mechanically generated are painful to read in a normal code review. A structural diff shows the handful of entries that genuinely moved.

Best practices

  • Diff the data, not the file. Running a text diff on JSON means a reformat shows up as a thousand changes and the one real change hides among them. Compare the parsed structures and formatting stops mattering entirely.
  • Read the removals first. Additions are usually safe; removals break consumers. Switch off Added and Modified and you have a list of everything that disappeared, which is the fastest way to spot an accidental deletion.
  • Treat a type change as a breaking change. A field going from 42 to "42" still looks like 42 in a log and still crashes anything doing arithmetic on it. The diff flags these separately for a reason.
  • Decide whether array order means anything. For a list of permissions or tags it usually does not, and leaving order significant fills the diff with moves that are not changes. For an ordered sequence of events it absolutely does. Set the option deliberately rather than by default.
  • Copy the path, not the line number. $.users[2].email stays correct when the document is reformatted or a key is added above it, and it pastes straight into a JSONPath tester. “Line 47” survives neither.
  • Attach the report rather than a screenshot. The HTML export is one self-contained file with the colours intact and nothing to fetch, so it still renders in a year on a machine that has never visited this site — and unlike a screenshot, the reader can search it.
  • Check the summary before trusting an empty diff.If a filter is active the header says so — “3 of 47 shown” — precisely so a narrowed view is never mistaken for a clean one.

Frequently asked questions

Is this JSON Diff free?

Yes. Every view, every filter and all three export formats are free, with no account, no sign-up and no limit on how many documents you compare.

Are my documents uploaded anywhere?

No. Both documents are parsed and diffed by JavaScript running in your browser. Nothing is sent to a server, nothing is stored and nothing is logged. You can disconnect from the network after the page loads and the tool keeps working — which is the point, because the documents people diff are usually API responses and config files they should not be pasting into a stranger's server.

What is the difference between JSON Diff and JSON Compare?

They share the same comparison engine and answer the same question in two different shapes. JSON Compare puts the documents in two aligned columns, which suits reading two versions side by side. JSON Diff shows one merged document in the unified format that Git, GitHub and code review tools use, with removed lines marked − and added lines marked +. Diff also adds filters by change type, a changes-only list with both values, and exports as a .diff file or a standalone HTML report. Use Compare to read two documents; use Diff to produce something you will paste into a pull request or a ticket.

What is a unified diff?

The format Git prints. Instead of two columns, you get one document with a marker in the left margin of each line: − for a line that only exists in the old version, + for one that only exists in the new, and a blank for lines that are the same in both. Two gutters number the lines in each version. It is the format almost every code review tool uses, so it is instantly readable to anyone who reviews code.

How does it detect what changed?

Both documents are parsed into data structures and walked in parallel, key by key and index by index. A key present on only one side is an addition or a removal; a key on both sides with different values is a modification. Because it compares parsed data rather than text, formatting, indentation and key order never appear as changes — only the data does.

Does key order matter?

No. Two objects with the same keys and values are identical whatever order they were written in, because JSON objects are unordered by definition. Reformatting a file, sorting its keys or switching from tabs to spaces produces no changes at all.

Does array order matter?

By default, yes — arrays are ordered, so moving an item is a real change. If you are diffing a list where the order carries no meaning, turn on 'Ignore array order' in the options and items are matched by content instead, so a reordered list reads as unchanged. On arrays beyond about 20,000 items this falls back to positional matching and the summary says so, because matching by content requires serialising every element.

What do the filters do?

They narrow the diff to the kind of change you are looking for. Turn off Added, Removed or Modified to hide that category, and use the Arrays or Objects limit to show only changes to list data or only changes to object properties. The counter in the result header always says how many of the total changes are currently shown, so a filter can never make you think there is less to review than there is.

Can I export the diff?

Three ways. The JSON report is structured data — every change with its path and both values — for feeding into another program. The plain text export is a standard unified .diff file for a ticket or a commit message. The HTML report is a single self-contained file with the colours intact and no external dependencies, so it can be attached to an issue or emailed and will still render on a machine that has never seen this site.

How large a file can it handle?

Documents up to about 20 MB of text each. Parsing happens in a background worker so the page stays responsive, and the views only render the rows currently on screen, so a diff with tens of thousands of changes scrolls smoothly. Very large documents that differ almost everywhere stop at an internal ceiling and the summary says the result was truncated rather than quietly showing you a partial answer.

What is a JSON path and why would I copy one?

It is the address of a value inside the document, written the way you would reach it in code: $.users[2].email means the email property of the third item of the users array. Every change in the diff has one, and the copy button next to it puts it on your clipboard, so you can paste it straight into a bug report, a test assertion or a jq expression.

Why does it say both documents must be valid JSON?

Because a diff between a document and a guess is not useful. If either side fails to parse, the status bar names the line, the column and what the parser expected, and clicking it jumps the cursor there. Unlike the formatter, this tool never auto-repairs your input: repairing one side would put a change on screen that exists in neither of your files.

What does 'type changed' mean?

The value exists on both sides but its JSON type is different — the string "1" became the number 1, say, or an object became an array. These are called out separately because they are the changes most likely to break something downstream, and they are easy to miss when you are only reading values.

Can I diff two files from my computer?

Yes. Use the upload button on either panel, or drag a .json file straight onto it. The file is read locally with the browser's FileReader; it is never transmitted. The panel then shows the file's name so the exported report says which files were compared.

Are there keyboard shortcuts?

Ctrl+Enter (Cmd+Enter on a Mac) runs the diff immediately, Ctrl+Shift+F opens the search, Ctrl+Shift+S swaps the two sides, Ctrl+Shift+L loads a new sample pair and Ctrl+Shift+Delete clears both panels. Escape closes the search. The previous and next buttons in the result header step through the changes one at a time.

Does it work offline?

Once the page has loaded, yes. Everything runs locally, so you can disconnect and keep diffing. A connection is only needed to load the page the first time.

Popular tools

↑ ↓NavigateOpenEscClose