Free JSON Diff / Compare Tool

Compare two JSON documents and see structural differences highlighted. Keys are sorted for semantic comparison. Runs in your browser — your data never leaves your machine.

JSON Diff
Original JSON
Modified JSON

🔍 Semantic Comparison

Compares JSON by structure and values, not by text formatting. Whitespace and key ordering differences are normalized away.

🔤 Sorted Keys

Keys are sorted alphabetically at every nesting level before comparison, so reordered keys don't produce false differences.

🎨 Color-Coded Output

Added lines are highlighted in green and removed lines in red, making structural differences instantly visible.

How to Compare JSON Documents

Paste your original JSON in the left panel and the modified JSON in the right panel, then click Compare. The tool parses both documents, sorts keys alphabetically, normalizes formatting, and highlights the differences line by line. Green lines are additions and red lines are removals.

Understanding JSON Diff

A JSON diff compares the structure and values of two JSON documents. Unlike a plain text diff, a JSON-aware comparison normalizes formatting and key ordering so that only meaningful changes are shown. This is especially useful when comparing API responses, configuration files, or database exports where key order may vary but the data is semantically identical.

Frequently Asked Questions

How does JSON diff compare documents?
The tool parses both JSON documents, sorts all keys alphabetically, and re-formats them with consistent indentation. It then compares the normalized output line by line using a longest common subsequence algorithm, highlighting additions and removals.
Does it sort keys before comparing?
Yes — keys are sorted recursively at every level of nesting. This means two JSON documents with the same data but different key ordering will show no differences, which is the correct semantic comparison.
What about formatting differences?
Formatting differences like extra whitespace, different indentation, or trailing commas are normalized away before comparison. Only structural and value differences are shown.
Can I compare nested objects and arrays?
Yes — the tool handles deeply nested objects and arrays. All levels are normalized and compared, so differences at any depth are detected and highlighted.
Is this tool free?
Yes — completely free, forever. No sign-up, no account, no usage limits. If you find it useful, a coffee is appreciated but never required.
Is my data safe?
All comparison happens locally in your browser using JavaScript. Your JSON is never uploaded to any server. It's safe to use with sensitive or proprietary data.