JSON Toolbox LogoJSONToolbox

JSON Compare

Compare two JSON documents online and identify added, removed, changed, and type-changed values. This browser-based JSON compare tool performs a structural comparison of objects and arrays, highlights differences by category, lets you ignore key order or specific fields, and helps you inspect changes by JSON path.

All processing happens in your browser. No JSON is sent to our servers.

Key Features

Side-by-Side Comparison

Compare the original and modified JSON next to each other, with added, removed, and changed values highlighted line by line in both editors.

Added, Removed, Changed & Type Changes

Separate differences into added, removed, and changed values, and detect type changes such as a number becoming a string or an object becoming an array.

Nested Path Context

Show where each difference occurs within the JSON structure, such as $.users[0].profile.name, and copy its JSONPath with one click.

Sort Object Keys

Normalize object key order before comparison so a different property order is not reported as a data change. Array element order is preserved.

Ignore Array Order

Treat array position as insignificant for unordered collections, so reordering items does not produce spurious changes.

Ignore Specific Fields

Exclude noisy fields such as updatedAt or requestId by name or path, so they are skipped during comparison.

Copy & Export

Copy every changed path, copy the full diff result, or export it as a text report for issues, code review, or documentation.

Swap Inputs

Swap JSON A and JSON B to reverse the comparison direction and view additions and removals from the opposite side.

Browser-Based Comparison

JSON parsing and comparison happen in your browser. No account is required and your documents are not uploaded to a server.

How to Use

1

Enter the original JSON

Paste the baseline or original document into JSON A. This version is used as the starting point for classifying added, removed, and changed values.

2

Enter the modified JSON

Paste the newer or comparison document into JSON B. The tool compares this document against JSON A.

3

Set comparison rules

Enable Sort object keys when key order should not matter, enable Ignore array order for unordered collections, and list fields to skip in the Ignore fields box.

4

Compare and inspect

Click Compare to parse both documents. Differences are highlighted in both editors and listed with their path, type, and old or new value.

5

Copy or export

Filter the result by type, copy changed paths, copy the full result, or export a report. Use Swap to reverse the comparison direction.

How to Compare JSON Files Online

What Is a JSON Compare Tool?

A JSON compare tool examines two JSON documents and reports how their structure and values differ. It is useful when you need to compare API responses, configuration files, test fixtures, exported data, or two versions of a payload.

A structural JSON comparison parses the documents before comparing them. This means formatting, indentation, and whitespace do not normally count as changes. The result can focus on meaningful data differences such as added properties, removed properties, changed values, and type changes.

Common Use Cases

  • API debugging: Compare expected and actual responses to locate missing fields, changed values, or unexpected types.
  • Configuration review: Compare environment-specific files or old and new configuration versions.
  • Data migration: Check whether records changed during an export, import, or transformation.
  • Regression testing: Compare snapshot outputs, test fixtures, or serialized results.
  • Code review: Review JSON payload changes without manually scanning two large documents.
  • Webhook and event debugging: Compare two event payloads to identify changes in nested properties or metadata.

How to Compare Two JSON Documents

  1. Enter JSON A: Paste the original or baseline document into the first editor.
  2. Enter JSON B: Paste the modified or newer document into the second editor.
  3. Choose normalization options: Sort object keys when property order should not matter. Use Ignore array order only when array position is semantically irrelevant. List fields to skip in Ignore fields.
  4. Run the comparison: Click Compare to parse and compare both inputs.
  5. Review the result: Inspect added, removed, changed, and type-changed values together with their JSON paths, then copy paths, copy the result, or export a report.

Understanding Difference Types

  • Added (green): A key or value present in JSON B but missing from JSON A.
  • Removed (red): A key or value present in JSON A but missing from JSON B.
  • Changed (yellow): A key present in both documents whose value differs.
  • Type changed (purple): A key present in both documents whose value changed JSON type, for example a number becoming a string.

Nested objects and arrays are compared recursively, so differences deep in the structure are also detected and shown with their full path.

Best Practices

  • Normalize first: Enable Sort object keys when the two documents were generated by different serializers that order keys differently.
  • Ignore noise: Use Ignore fields to skip volatile fields such as updatedAt, requestId, or timestamps that change on every run.
  • Reverse when needed: Use Swap to view the comparison from the other direction when debugging which side introduced a change.
  • Export for sharing: Copy changed paths or export the full result to attach to an issue or code review.

Browser-Based and Private

This JSON compare tool processes input in your browser and does not require uploading your documents to a server. For development data and configuration snippets this local processing is convenient. Still, avoid entering passwords, API keys, access tokens, or other highly sensitive information into any browser tool.

Related Articles

Related Tools

Frequently Asked Questions

Does this compare JSON semantically or as plain text?

The comparison is structural: both inputs are parsed as JSON, so whitespace and formatting do not count as data changes. Object key order can also be normalized when Sort Keys is enabled.

What types of differences can it detect?

It classifies properties or array values as added, removed, or changed. A type change, such as a number becoming a string or an object becoming an array, is reported as its own Type changed category.

Does it compare nested objects and arrays?

Yes. The comparison is recursive for nested JSON objects and arrays. Each difference reports its full JSON path, for example $.items[2].price.

What does Sort Keys do?

Sort Keys normalizes the order of object properties before comparison. This prevents a different property order from being reported as a meaningful change. It does not reorder array elements.

What does Ignore array order do?

It treats array position as less important when the array represents an unordered collection. Use this option carefully for arrays with repeated or partially changed objects, since pairing is still required.

Are arrays compared by index?

By default, arrays are compared by position, so inserting an item near the beginning can cause later indexes to appear changed. If the data is an unordered collection, enable Ignore array order.

Can I ignore specific fields?

Yes. List field names or paths in the Ignore fields box, separated by commas. You can use a bare key name like updatedAt, a wildcard prefix like *.updatedAt, or an exact path like users.profile.updatedAt.

What is a type change?

A type change is detected when a value's JSON type differs between the two documents, for example a number becoming a string or an object becoming an array. It is shown as a separate Type changed entry with the before and after types.

Can I compare JSON files with different sizes?

Yes. The documents do not need to contain the same number of properties, items, or nested levels. Missing properties are reported as removed or added according to the comparison direction.

Can I compare minified and formatted JSON?

Yes, provided both inputs are valid JSON. Formatting, indentation, and whitespace do not affect a structural comparison.

Can I compare numbers and strings with similar values?

A structural comparator distinguishes JSON types. For example, the number 1 and the string "1" are different values even though they look similar when displayed.

Can I reverse the comparison?

Yes. Use Swap to exchange JSON A and JSON B. This reverses which document is treated as the original and which as the modified version.

Can I load JSON from URL parameters?

Yes. You can prefill either editor with the ?left= and ?right= URL parameters containing JSON text. This only loads the text from the address; the tool does not fetch remote URLs.

Can I copy or export the result?

Yes. You can copy every changed path, copy the full diff result as text, or export it as a .txt report for issues, code review, or documentation.

Can I compare large JSON documents?

The practical limit depends on browser memory, device performance, document depth, array size, and the complexity of the diff result. Large comparisons may take longer and may benefit from filtering or exporting the result.

Is my JSON uploaded to a server?

No. Both documents are parsed and compared in your browser without a server upload. You should still avoid entering passwords, API keys, access tokens, or confidential production payloads into any browser-based tool.

Is this a free JSON compare tool?

Yes. You can enter two JSON documents, compare their structure and values, and inspect the differences without creating an account.