JSON DiffONLINE

Compare two JSON documents with readable added and removed lines.

1 MiB per input · Ctrl / ⌘ + Enter to run

Choose formatted line comparison or JSON-path comparison. Path mode ignores property order and equivalent number spelling.

Comparison report
Ready. Paste input, then run the tool.
Your JSON stays in your browser. Core processing happens locally.
THE PRACTICAL GUIDE

Compare JSON values without getting distracted by formatting

JSON Diff compares two versions of a document. Line mode emphasizes textual changes after formatting; path mode identifies changed values by location.

When should you use it?

  • Review a changed API response.
  • Compare configuration versions.
  • Identify which nested field caused a test failure.
WORKED EXAMPLE

Example: a changed property

Path comparison reports $["age"] as changed. Formatted line mode shows the changed text line.

Original
{"name":"Alex","age":32}
Changed
{"name":"Alex","age":33}

Choose line comparison or path comparison

Line comparison helps review a textual change after formatting both documents consistently. Path comparison answers which values changed at particular locations. Object property order is ignored in path mode, so moving a member does not become a data change. Equivalent numeric spellings are treated as equal there too. Use line mode if the exact spelling itself is under review.

Array order still has meaning

An array is an ordered sequence. If a service changes the order of results, an index-based comparison may show several changed paths even when the same records are present. Decide whether order is part of your contract before interpreting the result. For records identified by an id field, a business-level comparison may require matching those ids in your application rather than assuming that array positions identify the same entity.

AT THE WORKBENCH

See what changed between responses.

Paste an original response and a changed version. Compare formatted text or show changed JSON paths.

  1. Load the two versions

    Place the original on top and the changed document below it.

  2. Choose a comparison

    Use readable line changes or path-level changes.

  3. Review or download

    Minus lines were removed; plus lines were added. Export the .diff report.

IN PRACTICE

How do I compare JSON values when object key order changes?

Paste both versions and select path comparison when you care about data rather than textual layout. Path mode compares members by their locations, so reordering object keys alone is ignored. Use formatted line comparison when ordering or exact number spelling is part of the review.

JSON: equal objects in path mode

text
Original: {"name":"Alex","score":42}
Changed:  {"score":42,"name":"Alex"}
Path result: no data difference

Array order still matters. Swapping items in an array can change values at their indexed paths.

Line mode compares normalized formatted text, where member order and numeric spelling remain visible. Path mode compares JSON values and treats equivalent number spellings as the same value.

BEFORE YOU USE THE RESULT

What should you check before using the result?

Path mode ignores object order and equivalent number spellings, but arrays remain ordered. It rejects duplicate object names; very large comparisons may hit the worker time limit.

What counts as a difference?

Formatted line mode shows textual changes after indentation is normalized; object order and number spelling still count. Path mode compares JSON values, ignores object property order and equivalent number spelling, and reports added, removed, or changed paths. Array order still matters. Duplicate names are rejected in path mode.

Bounded comparisons

The worker stops expensive comparisons after a work or time limit. If two large inputs differ almost everywhere, compare a smaller section. Neither input is overwritten, and the report can be copied or downloaded locally.

Understand JSON syntax

Technical reference: JSON syntax and interoperability · RFC 8259

THE JSON FIELD GUIDE
All guides