JSON

JSON Compare

Compare two JSON files and instantly identify added, removed and modified properties.

JSON A

Valid

547 characters · 35 lines

JSON B

Valid

721 characters · 43 lines

Comparison options

Ctrl + Enter Compare ·Ctrl + Shift + S Swap inputs

Comparison results

Comparing…

JSON Compare, explained

What is JSON Compare?

JSON Compare is a structural diff tool that reads two JSON documents side by side and walks them node by node. Instead of treating the files as raw text, it understands their structure — objects, arrays, strings, numbers, booleans and nulls — so it can report precise, human-readable differences.

Every difference is reported as a path (for example user.address.city), the kind of change, and the affected values. Because the comparison is structural, reordering keys inside an object never triggers a false positive.

When to Compare JSON Documents

Any time data changes shape, a diff puts that change in plain sight. Common moments are before merging a branch that touches an API contract, after a dependency upgrade that ships a new response envelope, or when a configuration file is edited by hand.

The summary counts — added, removed, modified and type changes — give you an at-a-glance answer to 'did anything change?', while the tree view shows exactly where.

  • Reviewing pull requests that change payloads or schemas.
  • Verifying a refactor produced identical output (identical = green).
  • Tracking drift between environments before a deploy.

API Testing Use Cases

Paste a saved baseline response into JSON A and the current response into JSON B. The diff instantly shows which fields your API added, removed or altered — including subtle type changes such as a numeric id becoming a string.

This is especially useful after versioning decisions: it answers questions like 'does the new endpoint still include the fields my client parses?' without writing a single assertion.

Regression Testing

Snapshot a known-good output before a change and compare it to the output after. A green 'identical' result tells you the change was behaviour-neutral; any difference points straight at the affected paths, so a large refactor can be validated in seconds.

Pair this workflow with the downloadable report (comparison-report.json) to archive diffs alongside each release.

Configuration Comparisons

Config files (CI pipelines, container manifests, feature flags) are JSON-shaped and drift easily between staging and production. Compare them to catch a missing flag, a changed log level or an environment name swap.

Turn on 'Ignore property order' to focus on content rather than formatting, and 'Case sensitive' off when values legitimately differ only in casing.

Frequently asked questions

How do I compare JSON files?

Paste or type the first document into JSON A and the second into JSON B. Press Compare (or Ctrl+Enter). The summary panel immediately tells you how many properties were added, removed, modified, or changed type.

Does key order matter?

By default, no. JSON objects are unordered by specification, so {“a”:1,“b”:2} and {“b”:2,“a”:1} are treated as identical. You can optionally set 'Ignore property order' off for strict positional comparison if you need to track key sequences.

Can I compare nested JSON?

Yes. The comparison recurses through every level of nesting and reports the full dotted path for each difference — for example user.settings.theme, so you can pinpoint exactly where the change happened.

How large can the files be?

The engine is designed to handle documents of 2 MB and beyond. All parsing and comparison happens in a single fast pass, and the UI defers to the browser's requestAnimationFrame so the page stays responsive even with large payloads.

How are arrays compared?

By default arrays are compared by index — elements at position 0, 1, 2 and so on. If you turn 'Ignore array order' on, the engine matches elements by their canonical value regardless of position, which is useful when the same items appear in a different sequence.

What counts as a type change?

A type change happens when the same path holds values of different JSON types — for example a number 36 in the old document becomes the string “36” in the new one. This is tracked separately from a plain modification so you can surface schema-breaking changes at a glance.

What does 'Ignore whitespace' do?

When enabled, every string value is stripped of its internal whitespace (spaces, tabs, newlines) before comparison. This is useful when two documents are semantically identical but formatted differently.

What does 'Case sensitive' do?

With this option on (the default), comparing “Hello” and “hello” reports a modification. Turn it off to treat strings as case-insensitive, which can be handy for config files where only casing differs.

Is my data sent to a server?

No. Every step — parsing, diffing, tree rendering and report generation — runs entirely inside your browser. Nothing is transmitted, logged, or stored.

What happens if one input is invalid?

The tool shows an error banner under the affected editor, including the exact line and column where the syntax error was found. You can click 'Jump to error position' to move the cursor straight there. The comparison runs automatically once the error is fixed.

Can I share or save the results?

Yes. Click 'Copy result' to put a structured JSON report on your clipboard, or 'Download report' to save comparison-report.json locally. The report contains every change along with the options used.

What are the keyboard shortcuts?

Press Ctrl+Enter (Cmd+Enter on Mac) to run the comparison, and Ctrl+Shift+S to swap the two editors.