Data & Format / JSON Tools
JSON Diff
JSON Diff compares two JSON documents field by field and reports every difference as an added, removed or changed value, each tagged with the JSON path where it occurred, so you can see exactly what changed between a saved configuration and a new one.
This space is reserved for a sponsor. Every tool on this site stays free and runs locally in your browser.
This space is reserved for a sponsor. Every tool on this site stays free and runs locally in your browser.
How to use
- 1
Paste the two JSON documents
Put the original in the left box and the modified version in the right box. Both are parsed locally in your browser, so neither document is uploaded anywhere. You can paste a full API response, a config file or a saved payload.
- 2
Read the summary line
After comparison the tool shows how many values were added, removed and changed. If the two documents are equivalent as far as JSON is concerned, the count is zero even when the formatting or key order differs.
- 3
Inspect each difference with its path
Every change is listed together with the JSON Pointer to the value that differs, for example /users/3/active or /settings/theme/color. The path lets you jump straight to the spot in your source instead of scanning the whole file by eye.
- 4
Tell positional arrays from real edits
When an item is inserted in the middle of an array, every later element shifts by one index. The comparison reports array items by position, so an insertion can look like a cascade of changes. Where the values carry a stable identifier, align by that id rather than by position to get a meaningful diff. The same caution applies to deletions made in the middle of an array: they shift every later element back by one position, so a single removal can surface as a wave of deletions followed by a wave of additions at the tail. The cure is identical: key the rows by a stable id before comparing, and the diff collapses back down to exactly one real change instead of a cascade that looks far worse than the edit you actually made.
- 5
Watch key order and whitespace
JSON objects are unordered by specification, so rearranging keys or re-indenting the text does not count as a change. Only the values themselves and the array structure are compared, which is why two files that look different can still be reported as identical.
- 6
Copy the result
Copy the diff summary to your clipboard and paste it into a commit message, a pull request description, a bug report or a change log. Nothing you paste is sent to a server at any point.
Key facts
- SpecificationJSON text comparison has no single standard, but RFC 8259 defines the data model the comparison is built on: objects are unordered and arrays are ordered.Source:RFC 8259
- Object orderRFC 8259 section 1 states that JSON objects are unordered; conforming tools treat reordered keys as equal rather than as a change.Source:RFC 8259 §1
- Array orderArrays are ordered sequences, so element position is significant and an insertion shifts every later element by one index.Source:RFC 8259 §1
- Number precisionJSON has one number type represented as an IEEE 754 double; integers beyond 2^53 - 1 lose precision, so two near-equal big integers may compare unequal after a round trip.Source:RFC 8259 §6
- Difference pathsDifferences are reported as JSON Pointers defined in RFC 6901, the same notation used by JSON Patch, so the output drops straight into a patch or a test.Source:RFC 6901
- PrivacyParsing and comparison run entirely client side; no document is transmitted to any server.Source:This tool
Frequently asked questions
Does this tool upload my JSON?
No. Parsing and comparison run entirely inside the page using the JavaScript engine your browser already loaded, and no network request leaves your machine at any step. That matters because the documents you compare often carry API keys, session tokens, customer records or infrastructure details; a diffing service that round-trips your text through a server has written it into that server logs at minimum. You do not have to take this statement on trust: open the browser developer tools, switch to the network panel, paste two documents and compare them. No request appears. The only browser interface the page touches is the clipboard, and only when you press Copy.
Why does adding one item show so many changes in my array?
Because arrays are ordered in JSON, every element after an insertion shifts by one position, and the comparison matches elements by their index. Insert a value at position 2 of a ten-element array and the old element 2 is now at position 3, the old 3 is at 4, and so on, so each of those positions looks changed even though the values are the same. The fix is to compare by a stable identifier instead of by position: if each item has an id, build a map keyed by id and compare the maps, so an insertion simply adds one new entry and leaves the rest untouched. Some diff libraries do id-alignment automatically; this one reports positions, which is the honest default for raw JSON. When your data has ids, align on them before diffing.
Does the order of keys matter in the comparison?
No. RFC 8259, the current JSON specification, states that objects are unordered collections of name and value pairs, so two objects with the same members in different orders are the same object. This tool therefore treats reordered keys as equal and reports no difference, and it also ignores whitespace and indentation differences. Arrays are the opposite: their elements are an ordered sequence, so moving or inserting an element is a real structural change that the tool does report. If a difference report surprises you, check whether what moved was an array element, which is significant, rather than an object key, which is not.
Can it compare deeply nested objects?
Yes. The comparison is recursive and descends through arbitrary nesting depth, so a difference inside a third-level object or a value buried in a nested array is still reported, and it is still reported with its full path such as /response/data/items/0/tags/2. There is no fixed depth limit; the only practical bound is the memory available to the browser tab. Very large documents compare correctly but may take a moment, and extremely large ones can exhaust tab memory, in which case splitting the input into smaller pieces compares each part quickly.
What is the difference between added, removed and changed?
A value is added when its path exists only in the second document, removed when it exists only in the first, and changed when the same path holds a different value in each. A type change, for example a string where the other side had a number, counts as changed because the path is shared but the value is not. Note that because arrays are positional, an insertion shifts later elements and can produce a run of changed entries that are really the same values at new indices; aligning by id, as described in the array question, turns that run into a single clean addition.
Is there a size limit on the documents I can compare?
There is no upload limit because nothing is uploaded; the comparison happens in your browser. The real limit is the memory and responsiveness of the tab: a few megabytes compare almost instantly, tens of megabytes work but may take a second or two, and hundreds of megabytes can slow the page or exhaust memory. If you regularly compare very large payloads, split them into sections or compare the specific subtrees you care about rather than the whole document, which also makes the resulting diff easier to read.
How should I present a diff in a code review?
Lead with the summary counts rather than the raw output, because the counts tell a reviewer in one glance whether a change is a one-line fix or a structural rewrite. Paste the path-tagged list beneath them so anyone reading the review can jump straight to a specific value without scrolling through the whole document. When the diff is dominated by an array shift, call that out explicitly in your own words before the tool output, because a list of twenty changed entries that are really a single inserted item reads as alarming until someone notices the pattern and realises nothing was actually edited. If the documents are large, compare only the subtrees the pull request touches instead of the entire payload, which keeps the diff focused and readable for everyone. Keep the comparison local: pasting production data into a third-party diff site just to produce a screenshot sends that data to another party, whereas a locally run comparison produces the same list with nothing leaving the tab. Sharing the summary line alone is usually enough for a teammate to understand the change without opening the file. Finally, treat identical counts as meaningful signal rather than a non-event, since a zero-difference result after a reformat proves the running configuration is unchanged, which is exactly the reassurance a reviewer needs before approving.
Related tools
JSON Formatter
Paste JSON to pretty-print it with consistent indentation, minify it to one line, or find the exact line and column of a syntax error. Runs locally.
JSONPath Tester
Run a JSONPath expression against your own JSON and get every match together with the path that reached it. Filter, slice and search without writing code.
This space is reserved for a sponsor. Every tool on this site stays free and runs locally in your browser.