JSON Structure Compare

Compare JSON keys, values and types to locate additions, removals and changes. Keep large numbers precise, then copy or save a JSON report.

How to use

  1. Enter the before and after JSON.
  2. Run the comparison.
  3. Review changed paths and values, then copy or save JSON.

Two JSON inputs

Each UTF-8 input: 2 MB, 100,000 values including objects and arrays, and 32 nesting levels. Up to 10,000 changes and 5 MB output. Inputs, filenames and results are neither stored nor sent.

Comparison result

Compare JSON structure rather than text formatting

Object key order and indentation are ignored. Strings distinguish case, spaces and Unicode spelling. The string "1" and the number 1 are a type change.

Numbers 1, 1.0 and 1e0 have the same value; -0 equals 0. Large integers and decimals are compared without rounding through JavaScript numbers. Exponents allow up to 128 digits excluding leading zeros.

Arrays are compared at the same index. Reordering or insertion can therefore produce value changes at affected positions. There is no ID-based matching or move detection.

An added or removed array/object subtree counts as one change, as does a type change. Report paths use JSON Pointer: an empty path is the root, / in keys becomes ~1, and ~ becomes ~0.

The example produces one addition, one removal, one value change and one type change. Before/after values retain numeric digits and exponent notation. Original whitespace and string-escape spelling are not retained; inputs are unchanged.

A local browser worker performs comparison. Cancel stops the job; editing, replacing a file or resetting also stops a running comparison. After files load, select Compare.

Output uses UTF-8 without a BOM. The preview shows the first 20,000 characters; copy/save includes everything. Over-limit reports cannot be saved partially. Editing invalidates previous output until you compare again.

Try a use case and check the result

Separate object order and numeric spelling from array order and value types.

Example buttons replace the inputs and settings above and calculate. Restore previous input steps back one example at a time. After trying multiple examples, repeat restore to return to your original input. This history is lost when the page closes.

Key order and 1 versus 1.0 compare equal

Input and settings

Left: {"a":1,"items":[1,2],"enabled":true}
Right: {"enabled":true,"items":[1,2],"a":1.0}

Expected result

Equal / Added, removed, value and type changes are all zero

Swapping array items changes values; stringifying false changes type

Input and settings

Left: {"items":[1,2],"flag":false}
Right: {"items":[2,1],"flag":"false"}

Expected result

Two value changes: /items/0 and /items/1
One type change: /flag / Added 0; removed 0

How to read the result

Objects match by key and arrays by index. This is not an array-move detector, so swapping 1 and 2 changes two positions. Numeric 1 and 1.0 are equivalent, while boolean false and string "false" have different types.

Scope and limits

Limits are 2 MB per input, 5 MB output, 100,000 values, depth 32 and 10,000 changes. Numeric exponents allow 128 digits excluding leading zeros. Duplicate keys are rejected. This is neither line-based whitespace diff nor set comparison of arrays. Preview shows 20,000 characters; downloads include all output. Restore returns both JSON inputs/files and cancels a pending example Worker.

Verification: independent key/index/type comparisons give zero changes or two value/one type changes. Browser checks cover files, real Worker output, downloads and ignoring late results after restoration.

Continue with the next task

Frequently asked questions

Is null the same as a missing key?

No. Null is a present value. Removing a key is a removal; introducing one is an addition. False, zero and empty strings also retain their distinct values.

Can I compare JSON with duplicate keys?

Duplicate keys in either input are rejected to avoid silently losing entries. Invalid JSON or UTF-8 also stops comparison.

Can I save a report when the inputs match?

Yes. The report has equal set to true and an empty changes array. Both complete inputs must still be valid JSON within the limits.

Related tools

Inputs and storage

Keep any content you need before clearing. This tool does not autosave inputs or results. Reloading or closing the page, clearing inputs or resetting may discard your work.

Favorites and language preferences are stored separately and may be lost when site data is cleared. Tool resets and site-data deletion do not delete files already downloaded to your device.

Explore tools & games

All 120 tools · 16 games

All 120 tools · 16 games

Text & writing 26

Calculators & converters 22

Date & time 12

Images & PDF 26

Data & web 28

Random & handy 6

Games 16