What Is a JSON Diff?
A JSON diff compares two JSON documents and reports what changed — added keys, removed keys, modified values, and reordered arrays. Unlike a plain text diff, a JSON-aware diff understands that {"a": 1, "b": 2} and {"b": 2, "a": 1} are semantically identical (key order doesn't matter in JSON). Developers use JSON diffs constantly: comparing API responses across deploys, reviewing config changes, debugging why two clients render different data, or spotting unintended changes from a code generator.
JSON Diff Checker Online — What This Tool Does
This free JSON diff tool compares two JSON documents side-by-side with structural awareness. The tool normalises formatting (whitespace, indentation, optionally key order) before comparing, so only meaningful differences highlight. Green lines mark additions, red lines mark deletions. Runs entirely in your browser — no upload required.
How to Compare Two JSON Documents
- Paste your original JSON into the left pane.
- Paste the modified version into the right pane.
- Enable Sort keys to normalise key ordering before comparing — useful when comparing API responses where key order varies.
- Green lines highlight additions; red lines highlight deletions.
- Use Copy Diff to copy the unified diff to your clipboard.
- Click Swap to flip left/right if you had them backwards.
Common Use Cases
- API response comparison — paste two responses to spot which field changed between calls.
- Config drift — compare
config.jsonacross staging and production to find what diverged. - Schema change review — see exactly which fields were added or removed when reviewing a JSON schema change.
- Test fixture verification — compare expected vs actual JSON in test failures.
- Pull request preview — sanity-check before/after JSON in code reviews where the PR diff is noisy with formatting.
- Cache vs source — compare cached data against source to detect stale entries.
Why Sort Keys Before Comparing?
JSON spec does not guarantee key ordering. Two servers returning the same data may serialise keys in different order — producing a noisy diff that flags every key as moved. Enable Sort keys to alphabetise keys recursively before diffing. The result shows only real value changes, not order changes. Use cases where order matters (JSON arrays representing ordered lists, OpenAPI specs) should leave it off.
JSON Diff vs Text Diff vs Git Diff
JSON diff (this tool) is structurally aware — it can ignore key order and compares values not bytes. Text diff compares two strings line-by-line without understanding syntax — see our Text Diff Checker. Git diff is the command-line tool that compares working tree against a commit — same line-based algorithm but bound to repository history. For arbitrary JSON, this tool is the right pick because it produces fewer false-positive changes.
Tips & Tricks
- Always sort keys first — unless the order is semantically meaningful, sorting eliminates 80% of false-positive diffs.
- Format both sides first — paste each through the JSON Formatter if they came from different sources with different indent styles.
- Validate first — if one side is invalid JSON, the diff is meaningless. Use the JSON Validator to confirm both parse.
- For large arrays — sort the arrays themselves before diffing if their order doesn't matter (e.g. lists of unique IDs).
- Decimal precision —
1.0and1are the same number in JSON but render as different strings. Round both sides if precision drift causes false positives.
Related Tools
- JSON Formatter — Pretty-print both sides before diffing for consistent whitespace.
- JSON Validator — Confirm both inputs are valid JSON before comparing.
- JSON Viewer — Explore each JSON document as a collapsible tree.
- Code Diff Checker — Compare any text or code (not just JSON) with syntax highlighting.
- Text Diff Checker — Plain text comparison without syntax awareness.
Is My Data Sent to a Server?
No. JSON diff comparison runs entirely in your browser using JavaScript. Your data — including any API keys, user records, or proprietary payloads — never leaves your machine. There is no upload, log, or analytics on the JSON you compare. This is critical when debugging production responses that may contain personal data.