ToolSphere

JSON Diff Viewer

More tools

Compare two JSON files or strings online. Inspect added, removed, and changed keys by path with array and key order options.

Paste two JSON objects or payloads to inspect structural differences, added keys, removed properties, and type modifications by path.

Comparison summary

9 differences · 3 added · 2 removed · 3 changed values · 1 changed type

Inspecting differences by property path. Use options below to adjust array or key order sensitivity.

Differences by path

legacySupportremoved
Property "legacySupport" was removed
− Value: true
notesadded
Property "notes" was added
+ Value: "Upgraded to v2 architecture"
versionchanged value
Value changed from 1.2 to 2.0
− Old: 1.2
+ New: 2.0
settings.debugremoved
Property "debug" was removed
− Value: false
settings.regionadded
Property "region" was added
+ Value: "us-east"
settings.timeoutchanged type
Type changed from number to string
− (number): 5000
+ (string): "10000"
settings.retrieschanged value
Value changed from 3 to 5
− Old: 3
+ New: 5
tags[3]added
Array element at index [3] was added
+ Value: "cloud"
endpoints[1].pathchanged value
Value changed from "/api/v1/users" to "/api/v2/users"
− Old: "/api/v1/users"
+ New: "/api/v2/users"

Differences are detected structurally. Primitive values, nested objects, and arrays are inspected recursively. Numbers retain full precision without 64-bit truncation. Invalid JSON highlights the exact line and column offset to speed up debugging.

On this browser only

Give feedback

Did this tool help?

Tell us what worked, what didn’t, or what you’d like next.

Opens Google Forms in a new tab with this tool’s name filled in. No sign-in or email required. Feedback is optional.

How to use JSON Diff Viewer

  1. 1Paste or load your original JSON payload into the 'Original JSON (A)' editor.
  2. 2Paste your modified or updated JSON payload into the 'Modified JSON (B)' editor.
  3. 3Toggle comparison options to ignore array element ordering or object key order as needed.
  4. 4Inspect the count summary and path-level differences grouped by added, removed, changed value, and changed type.
  5. 5Filter by difference type or copy the generated diff report to your clipboard.

About JSON Diff Viewer

Structural JSON diffing vs line-based text comparison

Standard text diff tools (such as Git diff or GNU diff) compare text line by line. When two JSON payloads are formatted differently, minified on a single line, or have reordered keys, a text-based diff produces dozens of false differences that obscure real data changes. A single reformatted object or indentation change can flag an entire payload as modified even when the underlying data is identical.

This JSON Diff Viewer performs AST-based structural comparison. It parses both JSON strings into syntax trees, validates RFC 8259 compliance, and compares values by property path. It identifies added properties, removed fields, modified values, and data type changes regardless of whitespace, line breaks, or key formatting. This allows software engineers, API developers, and QA teams to isolate actual payload differences between API versions, database records, and configuration files immediately.

Understanding difference categories and path notation

Differences are grouped into four distinct categories to give you actionable clarity:

  1. Added: A key or array index exists in the modified JSON (B) that was absent from the original JSON (A).
  2. Removed: A key or array index exists in the original JSON (A) but was removed from the modified JSON (B).
  3. Changed value: The property exists on both sides with identical data types, but the underlying scalar value has changed (for example, false changing to true, or a timeout value updating from 5000 to 10000).
  4. Changed type: The property exists on both sides but its data type was altered (for example, a port number changed from a number 8080 to a string "8080", or an object transformed into an array).

Every difference is located with standard property path notation. Top-level properties appear with direct dot notation (such as settings.timeout). Array items include their zero-based bracketed index (such as endpoints[1].path). When property names contain spaces, dots, slashes, or Unicode symbols, the tool uses quoted bracket syntax (such as ["user.id"] or ["café"]), ensuring unambiguous tracking across deeply nested structures.

Array ordering and key order options

JSON specifications (RFC 8259) define an object as an unordered collection of zero or more name-value pairs. By default, our diff engine enables Ignore key order in objects, meaning {"a": 1, "b": 2} and {"b": 2, "a": 1} are treated as identical. If your application or serialization protocol requires strict property ordering, unchecking this option immediately flags key order discrepancies.

For arrays, JSON specifies that order is significant. By default, array items are compared index-by-index ([0] against [0], [1] against [1]). In many distributed systems, tag collections, or database query results, arrays represent unordered sets where sequence does not matter. Checking Ignore array element order treats arrays as multisets, matching identical items regardless of their array index and isolating only truly added or missing elements.

Preserving 64-bit integer IDs and large numbers

In standard JavaScript environments, native JSON.parse converts numbers into IEEE 754 64-bit floating-point values. This format provides 53 bits of integer precision, capping exact representation at Number.MAX_SAFE_INTEGER (9007199254740991). When diffing enterprise API responses containing 64-bit database keys, Twitter/Discord snowflake identifiers, or high-precision financial decimals, native parsing silently truncates trailing digits, causing different numbers to appear identical or identical numbers to mutate.

Our diff engine incorporates an integrated number tokenizer that preserves the raw textual representation of every number literal. Large integer identifiers (such as 1234567890123456789 vs 1234567890123456788) are compared using exact BigInt semantics, ensuring that snowflake IDs and arbitrary-precision values are never falsely reported as matching.

Worked example: comparing API response versions

The default loaded example demonstrates differences across all four categories between two versions of an API configuration:

Path Change type Original (A) Modified (B) Explanation
version Changed value 1.2 2.0 Minor version upgraded to major version
settings.timeout Changed type 5000 (number) "10000" (string) Number converted to string representation
settings.retries Changed value 3 5 Retry limit increased
settings.debug Removed false (undefined) Debug toggle removed from configuration
settings.region Added (undefined) "us-east" Cloud deployment region introduced
tags[3] Added (undefined) "cloud" Fourth tag appended to the tags array
endpoints[1].path Changed value "/api/v1/users" "/api/v2/users" User endpoint routed to v2 endpoint
legacySupport Removed true (undefined) Deprecated legacy flag removed
notes Added (undefined) "Upgraded to v2 architecture" Deployment release note added

The summary reports 9 differences: 3 added, 2 removed, 3 changed values, and 1 changed type. You can click any filter button to isolate specific change types or copy the full diff report to your clipboard.

Client-side validation and security

Validating syntax before comparing saves debugging time. When an invalid JSON string is pasted, our parser flags the exact line number, column offset, and token snippet, pinpointing missing commas, single quotes, or trailing commas immediately. All processing runs locally in your web browser. No JSON payloads, configuration secrets, or customer tokens are ever transmitted across a network, ensuring complete data confidentiality.

Frequently asked questions

How does structural JSON diffing differ from text diffing?

Text diff tools compare lines of text, which breaks when JSON is minified, reformatted, or when keys appear in different order. Structural JSON diffing parses both payloads into syntax trees and compares data values by property path, ignoring irrelevant whitespace and formatting changes.

Why does my JSON show as invalid when using single quotes?

Under RFC 8259 JSON standards, all property keys and string values must be enclosed in double quotes ("). Single quotes are rejected by JSON parsers. Replace single quotes with double quotes to make the input valid.

How does the tool handle array ordering?

By default, array items are compared index-by-index ([0] against [0], [1] against [1]). If you enable 'Ignore array element order', arrays are compared as multisets, matching identical items regardless of position and highlighting only truly added or missing elements.

Does key order matter when comparing JSON objects?

In standard JSON, object key order is not semantically significant. By default, 'Ignore key order in objects' is enabled, so objects with identical properties in different orders produce zero differences. Unchecking this option flags key order changes.

Can this tool compare large 64-bit integer IDs without rounding?

Yes. Standard JavaScript JSON.parse rounds integers beyond 9007199254740991 (53 bits). This tool uses a dedicated number parser that retains raw digit strings, comparing 64-bit database keys and snowflake IDs with exact BigInt precision.

What is the difference between a changed value and a changed type?

A changed value means the data type stayed the same (such as a string changing from 'admin' to 'user' or a number changing from 10 to 20). A changed type indicates that the data type itself changed (for example, a number 42 becoming a string '42', or an object turning into an array).

How are special characters or Unicode symbols displayed in property paths?

Alphanumeric keys use standard dot notation (user.name). Keys with spaces, dots, slashes, or Unicode symbols (such as 'café' or 'user.id') use quoted bracket syntax (such as ["user.id"]), ensuring paths remain unambiguous.

Can I export or copy the diff comparison results?

Yes. When differences exist, click the 'Copy diff report' button to copy a formatted, human-readable text summary of all path changes, added properties, removed items, and value modifications to your clipboard.

Is there a limit on how large the JSON inputs can be?

The tool supports payloads up to 200,000 characters per box in the browser. For optimal browser responsiveness, keep very large files under this limit or compare smaller sub-trees of your payloads.

Is my JSON data kept private and secure?

Yes. All JSON parsing, validation, and diffing algorithms execute entirely in your web browser's local JavaScript sandbox. No data is sent to external servers or logged anywhere.

Have a suggestion for JSON Diff Viewer?Share your feedback ↗