JSON Compare
Diff two JSON documents side by side.
Loading…
About JSON Compare
Scanning two API responses by eye for the one field that changed is slow and easy to get wrong. Put one document on each side and press Compare: the tool walks both structures and lists every difference by path, such as $.user.roles[1], marked added, removed or changed, with the old and new values. Key order and formatting do not count, and numbers are compared by value, so 1.50 matches 1.5 while two long integers that differ in the last digit do not.
Features
- Lists each difference by path, such as $.items[2].price
- Labels it added, removed or changed, with old and new values
- Ignores key order and whitespace
- Compares numbers by value, with long integers kept at full precision
- Names JSON A or JSON B when one of them has a syntax error
Limitations
- Arrays are compared position by position, so an item inserted near the start makes every later item show as changed.
- Differences appear as a list only, and the page has no copy or download button for it.
- Keys that contain dots or brackets are not escaped in paths, so such a path can be ambiguous.
How it works
- Paste the first document into the JSON A panel and the second into the JSON B panel.
- Select the Compare button in the middle column.
- Read the summary below the panels: Documents are identical, or the number of differences found.
- Go through the list. Each entry shows a path and a label, and changed values appear as a minus line and a plus line.
- Editing either panel clears the result, so select Compare again, or Clear All to start over.
Example input
{"name":"Auro","version":1}Frequently asked questions
- No. Objects are matched key by key, so the same keys in a different order, or with different spacing and line breaks, count as identical. Order only matters inside arrays.
- Array items are matched by index. Insert an item at position one and everything after it moves along by one place, so each later index is compared with a different value. Order the arrays the same way on both sides first.
- Yes. Numbers are compared by value, so 1.0, 1 and 1e0 match, and 1.50 equals 1.5. A string and a number never match, so "1" against 1 is reported as changed.
- It begins with JSON A or JSON B to tell you which panel failed, followed by the usual syntax message with the character position. No comparison runs until both panels hold valid JSON.
- No. The comparison runs in the page and neither document is transmitted. The tool has no download or copy action for the results, so nothing here needs an account.
