Home / Tools / JSON Diff
Free tool · runs in your browser

JSON Diff

Compare two JSON documents structurally — by key path, not by line. Reordered keys and different indentation are correctly treated as no change, so you see only the differences that actually matter.

Differences by key path

How it works

Why a line diff is the wrong tool for JSON

JSON objects have no meaningful key order — {"a":1,"b":2} and {"b":2,"a":1} are the same document. A text diff reports every moved line as a change, so reserialising a file with a different library can produce a diff hundreds of lines long that means nothing.

This tool walks both documents as trees and compares values at each key path, so key order and formatting are ignored entirely. What you get is a list of paths that genuinely differ.

How differences are reported

Each line gives the key path and what happened: + for a key present only on the right, - for a key present only on the left, and ~ for a path where both sides have a value but the values differ. Nested paths use dot notation and array indices use brackets, so local.model and providers[2] point exactly at what changed.

A type change — a value that was a string and is now a number — is reported as a change, since "1" and 1 are not the same JSON value.

Arrays are compared by position

Arrays are compared index by index. That is the right behaviour for ordered data, but it means inserting an element at the start reports every later index as changed. If your arrays are really unordered sets, sort both sides before comparing, or compare the elements you care about individually.

What people use it for

  • Comparing API responses between two environments, or before and after a deploy.
  • Checking what changed in a config when the file has been reformatted or regenerated.
  • Debugging a failing test that compares expected and actual JSON.
  • Reviewing a lock file or manifest where key order shifted but content mostly didn't.
  • Verifying a migration transformed only the fields it was supposed to.

Nothing is uploaded. This tool runs entirely in JavaScript in your browser. Your input is never sent to a server, never logged and never stored, and no account is required. Once the page has loaded you can go offline and it still works — open your browser's network tab and watch if you'd like to confirm it.

Frequently asked questions

Does key order affect the result?

No. The comparison is structural, so reordered keys are correctly reported as no change. This is the main reason to use a JSON diff rather than a text diff.

How are arrays compared?

By position, index by index. That suits ordered data, but inserting an element near the start will report every later index as changed. If your arrays are unordered, sort both sides first.

Is a string '1' the same as the number 1?

No. JSON distinguishes types, so a value that changed from "1" to 1 is reported as a change. That is usually exactly what you want to catch.

What does the key path notation mean?

Nested object keys are joined with dots and array elements use bracketed indices, so local.model is the model key inside the local object and providers[2] is the third element of the providers array.

Is my JSON uploaded?

No. Both documents are parsed and compared in your browser. Nothing is sent anywhere, which matters when a payload contains real data.

Tools that run where your code is

This page does its work in your browser because sending your data to a server to process it is a bad default. Catalase applies the same idea to AI coding: a free, open-source code editor that runs language models on your own machine through Ollama, with no account and no telemetry. Cloud models are there when you choose one, not by default.

Download Catalase freeWhat is Catalase?

Related tools

All 30 free developer tools →