Loading the JSON diff checker…

Enable JavaScript to compare two JSON documents in your browser.

Three clear steps

How to compare two JSON files online

Use the online JSON compare tool for API responses, configuration files, test fixtures, webhook payloads, or any other pair of strict JSON documents. It performs a data comparison; if the source serialization itself is the deliverable, read the semantic-versus-text distinction below.

  1. 1

    Paste the original and changed JSON

    Put the expected or earlier document on the left and the actual or newer document on the right. Remove credentials, access tokens, and personal data before working with any diagnostic example.

  2. 2

    Choose the comparison rules

    Keep arrays positional for standard JSON behavior, or select unordered comparison for set-like data. Turn on exact number tokens when 1, 1.0, and 1e0 must remain different.

  3. 3

    Review each changed path

    Check additions, removals, type changes, and modified values in context. Confirm the array-order rule and inspect any duplicate-key warning before treating the documents as equivalent.

Choose the right definition of “different”

Semantic JSON diff versus text diff

Two files can contain the same JSON data while looking very different, and two similar-looking files can represent different data. The correct comparison depends on the question you are trying to answer.

A semantic JSON diff parses both inputs before comparing them. Whitespace outside strings does not become a change, and object member placement can be ignored because a JSON object is defined as an unordered collection. This is the comparison LiveParse performs, and it is usually the useful view for API regression checks, configuration reviews, and tests that care about values rather than formatting.

A text diff compares the source representation. Reindentation, line-ending changes, escaped characters, property movement, and number spellings such as 1, 1.0, and 1e0 can remain visible. Use this view when reviewing a generated artifact, a version-controlled file, a signature-sensitive payload, or an exact serialization contract.

Neither approach is universally better. Semantic comparison deliberately removes some source-level detail; text comparison deliberately reports changes that may not alter the parsed value. LiveParse keeps exact number spelling available as a semantic comparison option, but it does not present a raw line-by-line text diff. Use a version-control or text-diff tool as a complementary check when the entire serialization is the artifact under review.

Semantic
Compares parsed types, paths, members, array items, and values under the selected rules.
Text
Compares the written representation, including layout and token spelling.
Path
Identifies where a change occurs inside nested objects and arrays.
Type
Distinguishes a JSON string, number, object, array, boolean, and null.

Order changes the answer

Object order and array order in a JSON diff

JSON objects and arrays have different ordering semantics. Treating them with one blanket rule creates noisy results or, worse, hides a real change.

Object member order is not data order

RFC 8259 describes an object as an unordered collection of name/value pairs. Moving "name" above "id" normally changes the source text but not the object’s meaning. A semantic comparison should match members by name, not by line position.

Array position is meaningful by default

An array is an ordered sequence. Swapping the first and second items changes their indices even when the same values remain present. Ordered comparison is the standards-aligned default for queues, ranked results, coordinate pairs, and step sequences.

Unordered arrays need an explicit rule

Some APIs use arrays to carry set-like tags, permissions, or feature names. Ignoring order can reduce noise for those fields, but JSON itself does not declare an array to be a set. Confirm whether duplicates and repeated objects are significant before using an unordered rule, then follow the guide to comparing JSON while ignoring array order.

Objects inside arrays need domain context

A list of records may be matched by position, or an application may choose a stable key such as id. A generic JSON diff cannot safely invent that identity rule. If order is unstable, verify records and repeated IDs before accepting the comparison.

Preserve the evidence in the source

Exact JSON number tokens and duplicate keys

Numbers and repeated member names expose differences that ordinary JSON.parse()-based comparison can erase. They deserve an explicit review when data integrity matters.

JSON defines a number grammar, but it does not require every implementation to preserve arbitrary precision or the original token spelling. Large integer identifiers may exceed JavaScript’s exact integer range, and long decimals may be rounded when converted to a binary floating-point value. Even when they represent the same mathematical quantity, 1, 1.0, and 1e0 are different source tokens.

An exact-token comparison is useful for 64-bit IDs, monetary decimals, scientific measurements, negative zero, and serialization tests. A value-oriented comparison may intentionally consider numerically equivalent forms equal; a source-oriented comparison should keep the distinction visible. Choose the rule that matches the downstream consumer.

Object names should be unique for interoperable JSON, yet the grammar does not make repeated names a syntax error. Many parsers keep only the last value, so {"role":"user","role":"admin"} can lose evidence during ordinary parsing. Inspect every duplicate-key warning and repair the producer rather than guessing which occurrence was intended.

64-bit ID
May be rounded if a parser converts it to an IEEE 754 double.
Decimal
May need its original scale, including trailing zeros, for a business rule.
Exponent
Can be numerically equal to another spelling while remaining textually different.
Duplicate
Can be overwritten, rejected, or preserved depending on the receiving parser.

Practical comparison workflows

JSON diff checker use cases for API responses

A useful comparison starts with a focused question: which contract, record, or environment changed? Keep the smallest representative payload that still demonstrates the behavior.

Compare expected and actual test output

Place a fixture or snapshot on the left and the failing response on the right. A semantic diff can reveal a missing property, a string-to-number type change, a changed nested value, or an array item that moved. Use the API response comparison workflow to redact volatile fields and verify contract changes.

Review API versions before a release

Compare representative responses from two versions or deployments. Pay attention to renamed fields, new nullable values, pagination metadata, error shapes, and order-sensitive collections that clients may depend on.

Check staging against production

Normalize environment-specific IDs, timestamps, and URLs in a safe copy, then compare the remaining structure. Do not paste secrets or live customer records; use redacted or synthetic examples whenever possible.

Investigate webhook and event changes

Compare a working event with a rejected one to isolate schema drift, absent fields, changed enum values, or a different item sequence. Preserve exact numbers when event IDs and monetary values must not be rounded.

Audit generated configuration

Use this semantic checker to ignore harmless reformatting, then add a separate version-control or text diff when stable serialization is part of a code review. A moved object member and a moved array item should not be interpreted as the same kind of change.

Prepare data for another format

Confirm the source JSON first, then use the JSON to CSV converter when the records need a spreadsheet-ready table. For one-record-per-line data, use the JSONL parser.

Decode timestamps before comparing payloads

When a diff contains opaque epoch values, open the Unix timestamp converter to identify seconds, milliseconds, microseconds, or nanoseconds and inspect the corresponding UTC date without rounding the original integer.

Questions answered

JSON compare and diff checker FAQ

What is a JSON diff?

A JSON diff describes differences between two JSON documents. A semantic diff reports changes to parsed values and paths, while a text diff reports changes to the written source. The results can differ because whitespace and object member placement do not necessarily change the data.

Is JSON object key order important?

Not to the JSON data model: an object is an unordered collection of name/value pairs. Object order may still matter to a source-text review, a human-readable convention, or a nonstandard downstream system, so use text diff when placement itself is under review.

Is JSON array order important?

Yes. JSON arrays are ordered, and an item’s index is part of its position in the document. Treat an array as unordered only when your application explicitly defines it as a set-like collection and you understand how repeated values should be handled.

Why can two equal-looking JSON numbers compare differently?

The tokens 1, 1.0, and 1e0 can represent the same mathematical value but have different source spellings. Large integers and long decimals can also be rounded by parsers. Use exact token comparison when spelling or precision is part of the contract.

What happens when a JSON object has duplicate keys?

Behavior varies by implementation: a parser may keep the first value, keep the last value, preserve every occurrence, or reject the document. RFC 8259 says object member names should be unique for interoperability. Treat a duplicate-key finding as an ambiguity to fix, not as a harmless formatting detail.

Is a JSON diff the same as JSON Patch?

No. A diff is a description of observed differences. JSON Patch, standardized in RFC 6902, is a specific array of operations such as add, remove, and replace that a compatible system can apply to a document. Not every visual diff is a safe or complete patch.

Can I compare invalid JSON?

A semantic comparison requires both sides to parse as JSON. Text comparison can still show source differences, but it cannot establish JSON-level equivalence. If an input has comments, trailing commas, single quotes, or truncation, inspect it with JSON Repair before comparing the repaired result.

Does the JSON comparison upload my documents?

The interactive comparison runs in the current browser tab. Your pasted documents are not required to be sent to a comparison API. You should still remove passwords, tokens, private keys, and personal data before placing any sensitive diagnostic payload in a browser tool.