JSON Diff Checker
Pinpoint line-by-line changes between two JSON structures
A text-style diff for two JSON documents
Developers are used to seeing changes as red and green lines, the way version control shows them. This checker gives JSON the same treatment: it validates both inputs, pretty-prints them with identical four-space indentation so that layout differences disappear, and then lists the lines side by side in one column, marking what was removed from the original and what appears in the modified version.
Using the checker
- Paste your earlier version into Original JSON and the newer one into Modified JSON. Load Samples fills both with a small pair that differ in a nested value and one list item.
- Click Run Diff Check.
- Read the results: unchanged lines appear in plain rows with their line number, removed lines have a red background and a minus sign, and added lines have a green background and a plus sign.
- Press Clear All to reset both boxes.
If either box holds invalid JSON, a pop-up displays the parser message and no diff is produced, which doubles as a quick validity check.
How the comparison works
Both documents are parsed, then written out again with the same indentation, and compared line by line from the top. Matching lines are shown as context. When the lines stop matching, the original's lines are marked as removed, and once they run out, the rest of the modified document is marked as added. That makes it a simple, greedy comparison rather than a full diff algorithm.
Best used for
- Reviewing a small change to a settings file, where the first difference is the interesting one.
- Confirming two documents are identical after formatting, since every line will be plain.
- Comparing a document before and after a script edits it.
- Making a quick visual for a bug report showing where two payloads first diverge.
Limits and a better companion
- After the first differing line, later lines that are actually unchanged can still be listed as removed and then added, because the comparison does not re-align the two sides. Expect long red and green blocks for changes near the top of big documents.
- Key order affects the result, since the comparison is text-based. Two objects with the same keys in a different order look different here.
- Line numbers refer to the reformatted text, not to your original pasted layout.
When you need a precise list of which fields were added, removed or changed regardless of order, use the JSON Compare tool, which reports paths instead of lines. Processing is done in your browser.
Related Tools