Skip to main content
{{{{}}}}[[[[]]]]::::,,,,
HomeToolsJSON Compare Online
JSON DIFF TOOL

JSON Compare Online

🔍 Compare two JSON objects instantly — deep recursive diff with added, removed, changed and type-changed highlighting at every level.

✅ 100% Free🔓 No Login Required🔒 Runs in Browser📂 File Upload Support⚡ Deep Nested Diff
Added Keys
Removed Keys
Changed Values
Type Changes

Want to format or beautify your JSON first?

Messy or minified JSON? Our JSON Formatter can pretty-print, validate and fix indentation before you compare.

Open JSON Formatter →

JSON A (Original)

No input yet

Upload .json

or drag & drop

JSON B (Modified)

No input yet

Upload .json

or drag & drop

Ready to compare your JSON

Paste JSON into both editors above, or upload .json files. You can also load the sample data to try it out.

File upload supported Instant deep diff Runs 100% in browser

What Is JSON Comparison?

JSON comparison — also called JSON diff — is the process of taking two JSON objects and identifying exactly what changed between them. Unlike plain text diffing, which compares lines, JSON diffing understands the structure of the data. It knows that { "a": 1, "b": 2 } and { "b": 2, "a": 1 } are identical, even though the key order is different.

This matters enormously in real development. API responses change between versions. Database records change after migrations. Config files diverge between environments. When something breaks, you need to know exactly what changed — not just that the JSON is different.

Common Use Cases

🔌

API Response Debugging

Compare the expected API response with the actual one to find missing fields, type mismatches or changed values.

🗄️

Database Migration Validation

After migrating data, compare a sample record before and after to verify every field migrated correctly.

⚙️

Config File Diffing

Compare config.json between environments — development, staging and production — to find unexpected differences.

📋

Version Comparison

Compare API versions to build a changelog. See exactly which fields were added, removed or changed between v1 and v2.

🧪

Test Assertion Review

Compare expected vs actual test output in detail when a JSON assertion fails.

🔄

Data Synchronization

Compare two data sources that should be in sync and identify which records differ and how.

Understanding the Diff Results

The comparison result has four change types. Added (green) means the key exists in JSON B but not in JSON A — it was newly introduced. Removed (red) means the key existed in JSON A but is missing in JSON B — it was deleted. Changed (yellow) means the key exists in both but the value is different. Type Changed (orange) is a specific and important category — the key exists in both and even the value looks similar, but the data type is different — for example a number became a string.

Type changes are particularly valuable to detect because they often indicate bugs that are invisible to the human eye. The number 42 and the string "42" look identical when logged but behave completely differently in code — one passes a numeric validation, one does not.

How to Compare JSON Files

With this tool you can compare JSON in three ways. First, paste directly — copy the JSON text from your editor, terminal, browser dev tools, or API client and paste it into the A or B editor. Second, upload a file — click the Upload .json drop zone in either panel header and select a .json file from your computer. The file contents load into the editor instantly. You can also drag and drop a .json file directly onto either drop zone.

Once both sides are populated, click Compare JSON. The diff tree renders immediately, with changed sections auto-expanded and unchanged sections collapsed by default to keep the result focused on what matters.

Should I Format My JSON Before Comparing?

Not necessarily. This tool parses the raw JSON regardless of indentation, so minified JSON compares correctly against pretty-printed JSON. However, if your JSON has syntax errors — missing commas, trailing commas, unquoted keys — you will get a parse error. In that case, use the Format button inside each editor panel to auto-indent and validate the JSON. For more powerful formatting and repair, our JSON Formatter tool can handle more complex beautification and error diagnosis.

Deep vs Shallow JSON Comparison

A shallow comparison only checks whether top-level keys changed. A deep comparison recurses into every nested object and array. This tool performs a full deep comparison — it will find a changed string buried inside a nested object inside an array inside the root object. Every field at every depth is checked.

Arrays are compared element by element by index position. This means if you insert an element at the start of an array, every subsequent element will be marked as changed even if its content is identical — because its index position changed. This is expected behaviour for positional array comparison. If you need semantic set-based comparison for arrays, consider pre-processing the data to use keyed objects instead.

Privacy and Data Security

All comparison logic runs entirely in your browser using JavaScript. No JSON data is uploaded to any server. No data is stored, logged, or transmitted. You can verify this by using the tool while offline — it works without any network connection after the page has loaded. This makes it safe to compare sensitive data like API credentials, private user records, or internal configuration files.

🔧 How It Works

Deep recursive JSON comparison with visual diff — instant, private, free

1

Paste or Upload JSON

Type or paste JSON directly into either editor, or click Upload .json to load a file from your device. Drag and drop also works.

2

Click Compare

Hit Compare JSON and get an instant visual diff showing added, removed, changed and type-changed fields across any level of nesting.

3

Filter & Export

Filter by change type, expand or collapse nested objects, and download a full diff report as a text file.

Frequently Asked Questions

Everything about JSON comparison and diffing

Do I need to sign up or log in to use this tool?

No. All QuickTextTools are completely free to use online with no login, signup, or account required.

Can I upload JSON files directly?

Yes. Each editor has an Upload .json button and a drag-and-drop zone. Click the upload area or drag a .json file from your computer into the drop zone and its contents will be loaded into the editor instantly.

How does the JSON comparison work?

The tool performs a deep recursive comparison of both JSON objects. It walks every key in both objects simultaneously and classifies each field as added, removed, changed, type-changed or unchanged. Nested objects and arrays are compared recursively to any depth.

What does type-changed mean?

Type-changed means a key exists in both JSON objects but the value type is different. For example, if the left has age: 30 (a number) and the right has age: '30' (a string), the field is marked as type-changed. This is a common bug in APIs and data migrations.

Can I compare nested objects and arrays?

Yes. The comparison is fully recursive. Nested objects are expanded and compared key by key. Arrays are compared element by element. Changed arrays show which indexes were added, removed or modified.

What do the colours mean in the diff?

Green with + means the key was added in JSON B. Red with - means the key was removed from JSON B. Yellow with ~ means the value changed. Orange with T means the type changed. Grey means the values are identical.

Is my JSON data sent to any server?

No. All comparison processing happens entirely in your browser using JavaScript. Your JSON data never leaves your device.

Can I download the comparison report?

Yes. Click Download Report to save a plain text diff showing all changes with their paths, old values and new values.

My JSON is messy — should I format it first?

You can use the Format button inside each editor panel to auto-indent and beautify the JSON before comparing. For more advanced formatting and validation, use our dedicated JSON Formatter tool.