JSON Compare
Paste two JSON documents, or open two files, and see exactly how their data differs. Each difference is listed with its path, the old value and the new value, and the report can be copied. Key order and formatting are ignored, and list order can be ignored too. Everything runs in your browser.
1 changed, 2 added, 1 removed
- changed$.versionwas "1.4.0"now "1.5.0"
- removed$.privatetrue
- added$.scripts.lint"eslint ."
- added$.tags[1]"free"
Spacing, line breaks and the order of keys are ignored. Numbers are compared by value, so 100, 100.0 and 1e2 are equal, and long numbers are not rounded. Text and numbers are different types, so "1" and 1 differ. Everything runs in your browser: neither document is uploaded.
Related Tools
[6 suggestions]JSON Formatter
Validate, pretty-print, and minify JSON with clear error reporting for invalid input.
Developer & WebDiff Checker
Compare two blocks of text line by line and highlight additions, deletions, and changes.
Developer & WebJSONPath Tester and Evaluator
Test a JSONPath expression against your JSON and see every match with its path, including filters, slices, wildcards and recursive search.
Developer & WebList Comparison Tool: Compare Two Lists Online
Compare two lists to see the items only in the first, only in the second, in both and in either, ignoring case and spaces if you want.
Line & ListsJSON to TypeScript Converter
Paste JSON and get TypeScript interfaces or types, with optional keys, unions and nested types worked out from your sample.
Developer & WebYAML to JSON Converter
Convert YAML configurations and documents into pretty-printed, valid JSON in real time with syntax validation.
Format ConversionAbout the JSON Compare
A line by line text comparison is a poor fit for JSON, because the same data can be written in many ways: keys in another order, other indentation, everything on one line. This tool reads both documents and compares the values. Objects are matched key by key, so a moved key is not a difference. Lists are compared in order, and the tool first lines up the items that are equal, so one inserted item is reported as one addition instead of making every later item look changed. Tick Ignore the order of items in lists when a list is really a set, such as tags or permissions; items are then matched wherever they are, and two changed objects are paired by the fields they still share. Paths start at $, the whole document: $.users[0].name means the name field of the first item in the users list, and keys with spaces or symbols appear in brackets. Types matter, so the text "1" and the number 1 differ, and so do null and a missing key. Numbers are compared by value, which makes 100, 100.0 and 1e2 equal, and they are read as written, so two long ID numbers that differ in the last digit are not rounded into the same value, as can happen in JavaScript. The reader is strict: comments, trailing commas and single quotes are reported with a line and column. When a key appears twice in one object, a note says so and the last value is used. Typical uses are checking what changed between two API responses, two configuration files or two exports. Neither document leaves your device.
Does key order matter when comparing JSON?▾
No. The JSON standard describes an object as an unordered set of name and value pairs, and this tool compares objects by key. Order matters in lists unless you tick the option to ignore it.
How do I read a path such as $.items[2].price?▾
Start at the top of the document, take the items key, then the third item of that list, since counting starts at 0, and then its price field.
Why are 1 and "1" different?▾
One is a number and the other is text. Programs that read the file will often treat them differently, so the tool reports the change.
Can it compare large files?▾
Each side can hold up to 2 million characters. Up to 300 differences are shown on the page, and the copied report holds up to 2,000.
Why does my JSON show an error?▾
Common causes are a comma after the last item, single quotes, keys without quotes and comments. The message gives the line and column of the first problem.
Is my JSON uploaded?▾
No. Both documents are read and compared in your browser, and nothing is sent or stored.