JSON Diff
Compare two JSON strings and highlight differences line by line. Free online JSON diff tool with added, removed, and changed line detection.
What is JSON Diff?
JSON Diff compares two JSON inputs and highlights the differences between them. Both JSON strings are normalized (pretty-printed with consistent indentation) before comparison, so formatting differences are ignored. The tool shows added lines (green), removed lines (red), and changed lines (amber) in a side-by-side view.
How to Use
- Paste the original JSON in the left panel
- Paste the modified JSON in the right panel
- Click Compare to see the differences
- Green lines are new, red lines are removed, amber lines are changed
Examples
Detect changed value
Find added fields
Related Tools
JSON Formatter & Minifier
Format, beautify, and minify JSON online. Free JSON formatter with syntax validation and error highlighting.
JSON Validator
Validate JSON syntax with detailed error reporting including line and column numbers. Free online JSON validator with instant feedback and structure analysis.
JSON Viewer
View JSON as an interactive collapsible tree with color-coded types. Free online JSON viewer with expand/collapse nodes and type highlighting.
Text Diff Checker
Compare two texts and highlight differences instantly. Free online diff checker with line-by-line comparison.
Frequently Asked Questions
Does formatting affect the comparison?
No. Both JSON inputs are normalized (parsed and re-formatted) before comparison. Whitespace, key order, and indentation differences are ignored — only actual data differences are shown.
How does the diff algorithm work?
The tool uses a Longest Common Subsequence (LCS) algorithm to find the optimal alignment between the two formatted JSON strings. This produces an accurate diff that correctly identifies added, removed, and changed lines.
Can I compare JSON arrays?
Yes. Both JSON objects and JSON arrays are supported. The tool compares the formatted output line by line, so it works with any valid JSON regardless of the top-level type.