Skip to content

JSON Compare

Compare two JSON objects with deep recursive comparison. Detects added, modified, and deleted fields at all nesting levels. Features ignore-order option for arrays, visual diff highlighting, and comprehensive statistics.

Category: code
Use Case: API Testing, Config Analysis, Data Migration
Privacy: 100% browser-based

Comparison Options

0 characters
0 characters

Recommended Settings

Comparison Features

  • Deep recursive comparison finds differences at all nesting levels
  • Ignore array order when element sequence doesn't matter
  • Visual diff highlights added (green) and removed (red) content
  • Statistics show exact counts of added, modified, and deleted fields

Best Practices

  • Enable 'Ignore array order' for API responses where order varies
  • Validate both JSONs before comparing to avoid confusing errors
  • Use swap button to quickly reverse comparison direction
  • Download diff results to document changes for review or auditing

Pro Tips

  • Arrays are sorted recursively when 'Ignore order' is enabled
  • Green badges show additions, blue shows modifications, red shows deletions
  • The visual diff viewer prettifies JSON for easy reading
  • Statistics count each nested field separately for accuracy

Most Popular

Most users compare with array order ignored for API response validation

When to Use This Tool

API Response Validation

Compare API responses between different environments (development, staging, production) or versions to detect unexpected changes in data structures, missing fields, or value modifications. Perfect for testing API compatibility, debugging version differences, or validating that backend changes don't break existing contracts.

Recommended: API Testing

Configuration File Analysis

Compare JSON configuration files between deployments, environments, or versions to identify what changed and why. Essential for troubleshooting deployment issues, auditing configuration changes, reviewing merge conflicts in config files, or understanding differences between environment-specific settings like development and production configs.

Recommended: DevOps & Deployment

Data Migration Verification

Verify data integrity after migrations, transformations, or imports by comparing source and destination JSON data. Crucial for database migrations, format conversions, ETL pipeline validation, or ensuring data wasn't corrupted, lost, or modified unexpectedly during transfer between systems.

Recommended: Data Engineering

How It Works

1

Paste or type first JSON into 'JSON 1 (Original)' field

2

Paste or type second JSON into 'JSON 2 (Comparison)' field

3

Tool validates both JSON inputs and shows error icons if invalid

4

Optionally enable 'Ignore array order' for order-agnostic comparison

5

Click 'Compare JSON' to perform deep recursive comparison

6

Statistics panel shows counts of added, modified, and deleted fields

7

Visual diff viewer highlights differences in side-by-side view

8

Copy diff results or download as JSON file for documentation

9

Use 'Swap Sides' to reverse comparison direction quickly

100% Private

Files never leave your device. All processing happens locally in your browser.

Lightning Fast

Powered by Client-side JavaScript with deep-object-diff library for optimal performance on modern browsers.

Open Source

Built with verified, open-source libraries. Fully transparent.

Frequently Asked Questions

What does 'Ignore array order' mean?

When enabled, this option treats arrays as equal even if their elements are in different orders. For example, [1, 2, 3] and [3, 1, 2] would be considered identical. This is useful when comparing API responses or datasets where element order doesn't matter semantically. The tool sorts arrays recursively before comparison, so nested arrays are also handled. Disable this option when order matters (like sorted lists or sequences).

How does deep comparison work?

Deep comparison recursively traverses through all nested objects and arrays, comparing values at every level of the JSON structure. It detects three types of changes: Added fields (exist in JSON 2 but not JSON 1), Deleted fields (exist in JSON 1 but not JSON 2), and Modified fields (exist in both but with different values). Unlike shallow comparison, it finds differences even in deeply nested objects like user.address.city.zipCode.

What do the statistics numbers mean?

Added (green): Number of new keys/fields that appear only in JSON 2. Deleted (red): Number of keys/fields that appear only in JSON 1. Modified (blue): Number of keys/fields that exist in both JSONs but have different values. Total: Sum of all changes detected. Each nested field is counted separately, so changing user.name and user.age counts as 2 modifications.

Can I compare minified JSON?

Yes! The tool automatically parses and handles JSON regardless of formatting. Minified (single-line) JSON, prettified (multi-line) JSON, and any mix of the two work perfectly. The comparison is structural, not textual, so whitespace, indentation, and line breaks don't affect results. The visual diff viewer shows both JSONs prettified for easy reading.

What if my JSON has syntax errors?

The tool validates both JSON inputs before comparison and displays clear error messages indicating which JSON is invalid and what the error is (e.g., 'Unexpected token', 'Missing closing brace'). You'll see a red X icon next to the invalid JSON with the specific error message from the JavaScript parser. Both JSONs must be valid before comparison can proceed.

Is my data safe and private?

Absolutely! All JSON comparison happens entirely in your browser using client-side JavaScript. Your JSON data is never sent to any server, uploaded anywhere, or stored. The deep-object-diff library and all processing run 100% locally, ensuring complete privacy and security for your sensitive API responses, configuration files, or business data.