JSON Diff

Compare two JSON values side by side. Additions, removals and changes are highlighted, and the detail list sits on the right.

or
 

Or try

or
 

Left JSON

 

Right JSON

 

Details

    What changed between two values

    Two pretty-printed objects can look similar and still differ by one field. This page parses both sides as strict JSON and lists additions, removals and changed values. It does not repair comments. That is JSON repair. Formatting one document is JSON formatter.

    How to use it

    1. Paste the first value in the left box and the second in the right box. Under each box, or and a file field load a .json file into that side.
    2. Compare sits between the boxes. The number of differences is shown above the result, the two values sit side by side, and Details is on the right. Green was only on the right, red only on the left, and amber changed. A blank line keeps the other side aligned.
    3. Previous and Next walk the list. Click a highlighted value, or a row in Details, to land on that difference.
    4. Show Example, under Compare, loads an order on the left: id A-1042, status open, customer Ada Lovelace in London with email [email protected], items PEN qty 2 and INK qty 1, note gift wrap, total 11.5. The right side keeps the id and the name, changes the email to [email protected], status to paid and total to 16.5, changes PEN qty to 3, replaces INK with BOOK at price 12, drops note and adds shipped false. Compare runs at once. The list is ~ $.customer.email, ~ $.items[0].qty, ~ $.items[1].price, ~ $.items[1].sku, - $.note, + $.shipped, ~ $.status and ~ $.total.
    5. If the values match, the line above says No difference. Edit again returns to the boxes and keeps the text. Clear All empties both boxes. Copy Result copies the detail list.

    How a line is written

    Paths start at $. Object keys are sorted, so source order is not a difference. An identifier key is written as .name. Other keys use ["key"]. Arrays are compared by index. A type change, including array versus object, is one ~ line. Each side must parse as JSON. A bad left side and a bad right side are separate errors. More than 400 difference lines stops instead of showing a partial list.

    Where people use it

    • Checking a response after a field was renamed.
    • Seeing which array item appeared or disappeared.
    • Confirming two exports are the same object.

    Questions

    Key order looks different, but the result says no difference.

    Objects are compared by key, not by the order they were written.

    A comment on the left failed.

    Both boxes need strict JSON. Take comments out on JSON repair first.