How to compare two JSON files
- 1Paste the original JSON into the left editor and the changed JSON into the right one. Each side shows whether it is valid JSON.
- 2The comparison runs as soon as both sides are valid. The badges above the results count the paths that were added, removed or changed.
- 3Read the side-by-side view, where removed lines are red on the left and added lines are green on the right, or switch to the Change list to see each path with its old and new value.
- 4Untick Ignore key order if the order of keys in an object matters to you, tick Show changed lines only to hide the unchanged parts, and use Copy changes to paste the list into a ticket or pull request.
How the JSON diff works
A text diff compares lines, so two JSON files that hold the same data can look completely different if the keys are in another order or the indentation changed. A JSON diff compares the data itself. The tool parses both documents, then walks them together, path by path, and reports where they differ. A key that exists only in the original is removed, one that exists only in the second is added, and a value that differs is changed.
Each difference is reported with its JSON path, such as $.user.address.city or $.items[2].price, so you can find it in either document or use the path in code. Objects are compared by key, so reordering keys is not a difference unless you untick Ignore key order, in which case a reordered object is reported on its own line in the list.
Arrays are compared by position. If an item is inserted at the start of a list, the items after it will show as changed, because each index now holds a different value. That is how most structural JSON comparison tools behave, and it keeps the output predictable for lists of records, settings and API responses.
A value that changes type, for example the number 1 becoming the string "1" or an object becoming an array, is shown as a change, because JSON treats them as different values. Both documents are parsed in your browser and never uploaded, so you can compare private API responses and configuration files.
When developers reach for it
Comparing API responses
Compare JSON online from two environments or two versions of an endpoint to see which fields were added, removed or changed.
Reviewing config changes
Diff a package.json, tsconfig or feature-flag export before and after a change, without noise from key order or indentation.
Checking test fixtures
Compare expected and actual JSON from a failing test and copy the list of differing paths into the bug report.
Verifying migrations
Check that a data export before and after a migration holds the same values, and find exactly which records moved.
Frequently asked questions
How is this different from a text diff checker?
+
A text diff checker compares lines of text. This JSON diff checker compares the parsed data, so reformatting, indentation and key order do not show up as changes. For a line-by-line comparison of any text, use the diff checker.
Does key order matter?
+
Not by default. JSON objects are unordered, so the same keys in a different order count as identical. Untick Ignore key order if you want a reordered object to be reported.
How are arrays compared?
+
By position: item 0 is compared with item 0, item 1 with item 1, and so on. Extra items at the end are shown as added or removed. Inserting an item near the start will therefore show later items as changed.
Can I compare two JSON files?
+
Yes. Open each file in a text editor and paste the contents into the two panels, or paste straight from your clipboard. Both sides are checked for valid JSON as you type.
Is my JSON uploaded?
+
No. Both documents are parsed and compared in your browser, so private data stays on your device.
What do the paths in the list mean?
+
They use a JSONPath-style notation: $ is the root, .name selects a key, and [0] selects an array item. Keys with spaces or symbols are written as ["first name"].
Related tools
Diff Checker
Compare two texts or code files and see added, removed and changed lines highlighted side by side or inline, down to the character. Private and in-browser.
JSON Formatter
Format and beautify JSON data with syntax highlighting and validation.
XML to JSON Converter
Convert XML to JSON with attributes and repeated elements handled, or convert JSON back to XML. Options for prefixes, arrays and types; nothing is uploaded.
JSON to YAML Converter
Quickly transform your JSON data into clean, formatted YAML. Features real-time validation, syntax highlighting, and easy copying.