Developer Tools Runs in your browser Free · no account

JSON Diff

The JSON diff tool compares two JSON documents and highlights added and removed lines. It sorts object keys before comparing by default, because key order carries no meaning in JSON — without that, a reordered payload would report as entirely rewritten.

Options
First JSON 0 characters
Second JSON 0 characters
Differences

Your result will appear here.

Not sure where to start? Use Load example.

Results update automatically and are calculated on your device. Nothing you type is sent to a server.

Runs in your browser. Processing happens entirely in your browser. Nothing you enter is sent to Delimiter.live.

How to use the JSON Diff

  1. Paste the original document into the first box.
  2. Paste the changed document into the second.
  3. Leave key sorting on unless the order of keys genuinely matters to you.
  4. Read the highlighted result: removed lines come from the first document, added lines from the second.

Example

Input
{"a": 1, "b": 2}
Output
  {
    "a": 1,
-   "b": 2
+   "b": 3
  }

Common use cases

  • Checking what a deployment changed in a configuration file.
  • Comparing an API response before and after a code change.
  • Reviewing a package-lock or manifest diff without the noise of reordering.
  • Confirming two exports from different environments really do match.

Limitations and things to watch for

  • The comparison is line based, on both documents formatted with two-space indentation. A change deep inside a long line is reported as that whole line changing.
  • Sorting keys changes the output ordering, so the diff shows sorted documents rather than your original formatting. Turn it off if you need to compare the files exactly as written.
  • Very large documents are compared in memory with a quadratic algorithm, so a pair of multi-megabyte files can take several seconds.

Frequently asked questions

Why are my keys reordered in the output?
Because key sorting is on by default. JSON object key order is not semantically meaningful, so sorting both sides means the diff shows real value changes rather than incidental reordering. Turn the option off to compare the documents exactly as written.
Does it show a semantic diff or a text diff?
A text diff of both documents after normalising formatting and, by default, key order. That catches every real difference, but it reports changes by line rather than describing them as "value at path x changed".
Are my documents uploaded?
No. Both are parsed and compared in your browser, so you can compare production payloads without them leaving your device.
Will it tell me the documents are equivalent?
Yes. When no lines were added or removed, the result says the two documents are equivalent rather than showing an empty diff.

Share this tool