Back to Tools

JSON Diff Checker

Pinpoint line-by-line changes between two JSON structures

Original JSON
Modified JSON

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

  1. 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.
  2. Click Run Diff Check.
  3. 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.
  4. 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


Frequently Asked Questions

Why are unchanged lines shown as removed and added?
The tool compares lines in order and does not re-synchronise after a mismatch. Once lines stop lining up, the rest of the original is marked removed and the rest of the modified text added. Use JSON Compare for field-level accuracy.
Does key order affect the diff?
Yes. Because both documents are turned into text and compared line by line, the same keys in a different order appear as differences. JSON Compare ignores key order and reports differences by path.
What happens with different indentation in my inputs?
It does not matter. Each input is parsed and re-printed with four-space indentation before comparing, so spacing, line breaks and minified versus expanded layouts are all treated the same way by the diff.
What do the line numbers mean?
They count lines in the reformatted version of each document, not in what you pasted. Removed lines use the original's numbering, and added lines use the modified version's numbering, so numbers may not match your source layout.
Can I use it to check that two files are identical?
Yes, in the sense of same data and same key order. If every row appears plain with no colour, the reformatted texts match. Differences in key order will still show up, so identical data may not always look identical here.
Support Chat
We typically reply within minutes

Hello! 👋 Before we start, please tell us your name.