JSON

JSON Compare

Compare two JSON documents and instantly identify added, removed, modified, and type-changed 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…

Your data stays private

This tool runs directly in your browser. The content you enter is processed locally and is not sent to TechFixGen servers. No account or signup is required.

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, formatting differences between the two documents never register as changes.

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 under your chosen options (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.

For comparing a list of records rather than a single object, turn 'Ignore array order' on: the engine then matches records by their content, so a re-sorted response reports as identical instead of a wall of positional modifications. Because that matching is exact, a record that genuinely changed shows up as one removed plus one added.

Regression Testing

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

One thing to know about regression snapshots: whitespace inside string values counts as a difference by default, so a refactor that changes spacing inside a value is reported rather than hidden. Turn 'Ignore whitespace in string values' on only if you specifically want spacing-only edits to compare as equal.

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.

'Ignore property order' is on by default, so a reformatted file still compares as equal. Turn it off only when the exact key sequence is part of what you care about. Two options are worth adjusting for config work: switch 'Case sensitive' off when values legitimately differ only in casing, and switch 'Ignore whitespace in string values' on when a value's internal spacing is not meaningful — an indented log line, for example, is still the same message.

Frequently asked questions

How do I compare two JSON documents?

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. Paste the text directly — there is no file picker, so copy the contents of your .json files into the editors.

Does key order matter?

By default, no — 'Ignore property order' is on, which follows the JSON specification: objects are unordered maps, so {“a”:1,“b”:2} and {“b”:2,“a”:1} are treated as identical. Turn it off for strict positional comparison; in that mode a reordered key is reported as one removed plus one added at the position it moved to, rather than as a move.

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 documents be?

There is no byte-size limit, and the test suite exercises documents with tens of thousands of keys. Identical subtrees collapse to a single comparison, so comparing two large documents that mostly match stays cheap. Documents nested more than 2,000 levels deep are rejected by the JSON parser before comparison starts.

How are arrays compared?

By default arrays are compared by index — element 0 against element 0, 1 against 1, and so on — so reordering items shows up as several modifications. Turn 'Ignore array order' on to match elements by their exact content regardless of position, which suits documents whose items arrive in a different sequence. Matching is exact rather than approximate: an element that actually changed is then reported as one removed plus one added instead of a modification, so the modified count drops to zero for array changes.

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. It is counted separately from ordinary modifications so type-level changes stand out, and appears in the Modified tab with a badge showing the old and new type. This compares the observed types in your two documents; it does not validate either one against a JSON Schema.

What does 'Ignore whitespace in string values' do?

It is off by default, so a change in spacing inside a string value is reported as a difference and "hello world" and "helloworld" are not identical. Turn it on when spacing-only changes should be treated as equal; when enabled, whitespace anywhere inside a string value — not just at the ends — is stripped before comparison. Formatting whitespace between keys and values is never affected either way, since both inputs are parsed before they are compared.

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. Comparing, diffing, and report generation happen locally in your browser. Your JSON documents are not uploaded to TechFixGen.

What happens if one input is invalid?

An error banner appears above the affected editor, naming which side failed and giving the exact line and column. The offending line is also marked in that editor's gutter. Use 'Jump to error position in JSON A' (or JSON B) 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 immediately instead of waiting for the debounce, and Ctrl+Shift+S (Cmd+Shift+S on Mac) to swap the two editors. Comparison also runs on its own shortly after you stop typing.