Logo JSON Parser Online

Compare Two JSON Objects Online

Paste your first JSON into the INPUT 1 pane (left) and the second into INPUT 2 (right), then click Compare. Added lines are highlighted green, removed lines red, and changed lines yellow. The status bar shows the total count of each.

All JSON Tools

28 tools

Free, fast, runs in your browser. No login needed.

Made with ❤️ in India · © 2025 parsejsononline.com
INPUT
1
OUTPUT
1
✅ Ready
Characters: 0
Ctrl+Enter to run
What is this tool?

How to use

  1. Paste your first JSON into the INPUT 1 pane on the left.
  2. Paste your second JSON into the INPUT 2 pane on the right — it replaces the usual output pane.
  3. Click Compare.
  4. The diff view shows added (green), removed (red), and changed (yellow) lines.
  5. The status bar shows the count: N added N removed N changed.

How it works

The tool stringifies both inputs with JSON.stringify(a, null, 2), splits the result into lines, then compares line i in the first input against line i in the second. Lines that differ are marked changed; lines that only exist in one input at that position are marked added or removed.

Important: this is a positional diff, not a semantic one. It compares the textual representation of each JSON object, not the structure. The practical consequence: if you insert a new property near the top of an object, every property that follows it shifts down one line and will appear as "changed" — even if its value is identical in both inputs. For small, isolated changes (a single value update, a field added at the end) the output is clean and readable. For structural differences, the line counts become less meaningful.

What normalizes automatically: both inputs are parsed through JSON.parse() before diffing, so whitespace and indentation differences between the two are ignored. You can paste a minified string in one pane and a formatted string in the other and the diff will still be accurate.

What it does not do: three-way merges, key-based semantic diffing, diff of non-JSON content, or automatic conflict resolution.

If either input fails to parse as valid JSON, the tool returns an error for that pane and does not run the diff.

FAQ

How is this different from a text diff tool?

Both inputs are parsed through JSON.parse() before comparing. Whitespace and formatting differences are ignored — only actual data differences appear in the output. A plain text diff would flag indentation changes; this tool does not.

Why are many lines showing as changed when I only updated one value?

The diff is positional: it compares line N in the first input to line N in the second. Inserting a property near the top of an object shifts all subsequent lines, causing them to show as changed. For isolated value edits this works cleanly; for structural insertions the output is noisier.

Does it handle deeply nested JSON?

Yes. Both inputs can be arbitrarily nested. The diff operates on the pretty-printed (2-space) serialized form of each.

Is my data sent anywhere?

No. Both panes and the diff calculation run entirely in your browser. Neither JSON object is transmitted.

What happens if one input is invalid JSON?

The tool reports a parse error for that pane (prefixed INPUT 1: or INPUT 2:) and does not run the comparison until both are valid.

Related tools

JSON FormatterFormat both inputs consistently before comparing. JSON ValidatorCheck that each input is valid JSON before diffing. JSON Repair / FixFix malformed JSON before running a diff.