About JSON Diff
A line-by-line diff of two JSON files drowns in noise when keys were reordered or the indentation changed. This tool compares what the documents mean instead: keys in any order, 1.0 equal to 1, whitespace ignored. What is left is a list of real differences, each with its path, such as $.database.pool, and the value before and after.
Arrays are compared item by item. By default equal items are matched up first, so an element inserted at the top of a list shows as one addition rather than every later item changing. Choose By position when the index itself matters.
How it works
- Both documents are read by a strict JSON parser that keeps numbers exactly as written, so ids that differ only in their 19th digit are still told apart.
- Objects are compared key by key regardless of order. Numbers are compared by value, and a value whose type changed, say from "1" to 1, is reported as changed.
- Arrays are aligned on their longest run of equal items; the items left over on each side are paired up and compared in turn, and the rest count as added or removed. Very long arrays that differ throughout are compared by position instead, and you are told.
- The work runs in a background thread, so the page stays responsive while two large documents are compared.
Questions
Which index does a path show when items moved?
A removed item is shown at its index in the original, and an added or changed item at its index in the changed document. With By position, both are the same index.
Does the order of keys or the spacing count as a difference?
No. Neither changes the data, so neither is reported. Use the text diff tool if you need to see formatting changes as well.
How many differences are listed?
All of them are counted. The table shows the first 500, which is usually enough to see what happened; the totals for added, removed and changed always cover the whole comparison.
How large can the documents be?
Up to 5 MB each. Both stay in this browser tab; nothing is uploaded.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.