JSON Diff Tool
Loading tool controls…
JSON Diff Tool At a Glance
A JSON diff tool identifies where two structured JSON values disagree. Unlike a line-by-line text comparison, it first parses the input into objects, arrays, strings, numbers, booleans, or null, then compares the values at corresponding paths. This lets the tool regard two objects with different indentation or rearranged keys as equivalent when their actual contents match. The output describes added, removed, and changed values with JSON Pointer paths such as /settings/theme or /items/2/price.
Paste the original document on the left and the updated document on the right. By default, the comparison ignores the order of object keys but retains the positions of array elements. You can optionally compare arrays without regard to order, using their values as a multiset rather than assuming that every entry is interchangeable. The downloadable JSON report contains the recorded differences and a note describing the chosen comparison method. A match indicates equality under those rules, not necessarily the same serialized file bytes.
How to Compare Two JSON Documents
Copy both documents into their respective input fields. Use the left side for the previous or expected value, and the right side for the new or actual value. Press Compare JSON to generate a set of differences. If a document has invalid syntax, the tool reports which input could not be parsed rather than comparing a partial interpretation. Correct trailing commas, improperly escaped quotes, or other syntax problems before assuming that a missing result represents identical data.
The output presents an initial set of differences for quick review and offers a complete structured download within the tool's reporting limit. A path such as /profile/email means the value associated with email inside profile changed, while /orders/0/status points to the status field of the first array item. JSON Pointer escapes a slash in a property name as ~1 and a tilde as ~0, so paths remain unambiguous even when unusual characters appear in field names.
Semantic Equality Is Different From Textual Equality
JSON files can represent the same data despite different spacing and object-key order. For example, {"a":1,"b":2} and {"b":2,"a":1} describe equivalent objects. A plain text diff would highlight the rearranged source text, whereas a structural comparison treats the objects as equal. That distinction is helpful when examining API responses, configuration exports, or application state that is formatted differently by separate systems.
Data types remain important, however. The number 5 is not the same JSON value as the string "5", and false is different from null or an absent field. Structural comparison also does not interpret a property name such as userId as an instruction to match array items by that identifier. If an API returns the same collection in a different sequence, you must decide whether array positions have meaning before changing how arrays are compared.
Added, Removed, and Changed Values
An added value appears in the right document but has no corresponding property or position in the left. A removed value appears only in the original. A changed value appears in both but its value or type differs. For instance, changing {"enabled":false} to {"enabled":true} is a changed value at /enabled; adding {"region":"EU"} introduces a new property at /region. These categories make a long report easier to review than a single count of mismatched characters.
When an array grows, the tool can report elements at newly created positions as additions. If an array shrinks, trailing positions become removals. Reordering elements can therefore produce many apparent changes even though the same elements still exist. This is expected for a positional comparison, because array ordering can be meaningful for ranking lists, workflows, or sequences of actions. Do not treat a large number of array differences as proof that the underlying records are entirely unrelated.
How JSON Arrays Are Compared
Under the default setting, arrays are ordered: the object at index 0 is compared with the object at index 0, followed by index 1, and so on. This is the correct approach for many application settings and ordered API outputs. If you select Ignore array ordering, the tool compares arrays as multisets of their normalized JSON values. Object key order within those values is ignored, and repeated values still count separately.
Unordered comparison has limits. If two objects within an array share an ID but different properties, they may register as differences at the array itself rather than as individual nested field changes. For a more detailed record-level comparison, first transform the arrays into objects keyed by stable identifiers, or compare matching records separately. Do not enable unordered comparison merely to make the number of differences smaller; choose it because the actual application treats the collection as unordered.
Reviewing Configuration Changes Safely
JSON frequently stores settings that influence how an application behaves. A single boolean change might enable logging, a different endpoint value may redirect traffic, and a missing required field can prevent startup. A diff report can highlight these changes before a configuration is deployed. Read both the property path and its surrounding context, because the same field name can mean different things in separate parts of a document.
Consider an application configuration with a payment provider's secret key. Even if the comparison itself is performed on supplied text, avoid copying credentials into collaboration messages or saving a diff report that exposes them. Replace secrets with placeholders before sharing diagnostic output. The JSON Formatter and Validator can help identify syntax errors first, but valid JSON syntax does not mean a configuration is safe or correct for its intended service.
Worked Example: A Product API Response
Suppose one response contains {"id":"A12","price":19.95,"available":true} and the next contains {"available":false,"id":"A12","price":21.50}. A text diff notices that the keys have been reordered. A structural comparison ignores that distraction and reports changes to /price and /available. The ID remains unchanged. This focuses attention on a stock-status change and the price difference rather than on harmless formatting choices made by the producer.
Now imagine a nested object with an array of prices for several product variants. If variant order changes, a positional diff may match the wrong variants together. Before presenting such a report to someone making pricing decisions, check whether the application guarantees the order of that array. If it does not, a comparison keyed by each variant ID will usually be more informative. A generic diff cannot infer the business meaning of every field automatically.
Handling Large JSON Structures and Truncated Reports
Very deeply nested or large JSON documents can create more differences than a page can display comfortably. The inputs are limited to 1 MB each, and the comparison caps the number of recorded changes. When that cap is reached, the result states that the report is truncated. Do not conclude that the recorded count is the total number of differences. Instead, narrow the input to the relevant branch or compare smaller sections independently.
The first portion of the result is intended for inspection, while the downloadable JSON file carries the recorded paths and before-and-after values. Always review sensitive values before exporting or forwarding it. Changes involving embedded markup, URLs, or text are reported as values, not executed, and the tool should not be used as a substitute for application integration tests. A configuration can be structurally equal and still behave differently if external data, environment variables, or defaults changed elsewhere.
How to Interpret Differences With Schemas and Tests
Structural comparison answers one question: what changed between these two JSON values? It does not answer whether the new value is permitted or useful. A JSON Schema Validator can check whether the new document conforms to specified types, required properties, and validation rules. You might first diff a response to locate a newly added field, then validate the revised response to determine whether the field's value meets the application's contract.
When data is converted between tabular and structured formats, a CSV to JSON converter is useful for building comparable JSON objects from CSV records. The conversion settings matter because numeric strings, empty cells, and leading-zero IDs can change meaning when data types are inferred. Establish the intended types before comparing the converted result with an API payload; otherwise the diff may reveal conversion choices rather than substantive business changes.
Frequently Asked Questions About Comparing JSON
Does changing the order of JSON keys count as a difference?
No. Object properties are matched by name, not by the order in which they appear in the source. Two objects with identical property names and corresponding values are equal even if the properties have been rearranged. Arrays are different: their element positions are compared by default because many applications use arrays to represent meaningful sequences.
Why does the report show /items/0 instead of a record ID?
A JSON Pointer path identifies the physical position of an array element or the name of an object property. /items/0 is the first item in the items array; it is not necessarily the record whose identifier is zero. To match records by an ID instead of position, transform the structure or compare individual records after selecting their identifiers.
Can I compare JSON documents that are formatted differently?
Yes. Spaces, tabs, line breaks, and ordinary indentation do not affect parsed JSON values. A document with trailing commas or invalid quotation marks is not valid JSON, however, and must be corrected before a semantic comparison is possible. If a parser error appears, inspect the document syntax rather than ignoring it.
Does the tool validate the meaning of the data?
No. It reports differences between parsed values under its comparison rules. A new endpoint URL, deleted access-control setting, or modified tax amount can be structurally valid but still be wrong for the application. Validate changes against your system's requirements and run functional tests where behavior matters.
What does Ignore array ordering do?
It compares the array elements as a collection of values, preserving the number of times each value occurs. Two arrays containing the same items in different positions can then compare equal. This does not perform record matching by a particular property, so it is best used when the application genuinely treats the array as an unordered collection.
Why is my differences report truncated?
The tool limits the number of reported differences to keep processing and browser output manageable. A truncated report means additional differences may exist. Compare a smaller object subtree or address the first set of problems and repeat the comparison. Do not treat a truncated difference count as a complete audit of the input documents.
Is JSON diff the same as version control?
No. A structural diff compares two snapshots. Version control also records history, authorship, branches, approvals, and changes over time. The diff tool can assist with a one-off review of configuration values or API responses, but it does not replace a version-controlled development workflow or an audit trail.