JSON Diff

Paste two JSON documents to compare their structure. Key order is ignored and every difference is listed with its path.

Este contenido está en inglés.

Ejemplos resueltos

Finding a changed city

Old {"city":"Leeds","tags":["a"]} and new {"city":"York","tags":["a"]}

Changed $.city: "Leeds" to "York"

The path $.city shows exactly where the difference is, and the key order does not affect the comparison.

Comparing lists ignoring order

Lists ["red","blue"] and ["blue","red"], with ignore order selected

No differences found.

Ignore order is the right choice for lists of tags or identifiers where position does not matter.

Sobre JSON Diff

A JSON diff compares two documents by their structure rather than their text. Reordering keys, changing indentation or adding blank lines does not count as a change, so what you see is only what really differs. Each difference is listed with a path such as $.address.city or $.items[2], together with the old and new values, and a summary counts how many values were added, removed or changed. It is a quick way to review a change before you accept it, whether the documents come from an API, a database export or a configuration file.

Lists need extra care, so you can choose how they are compared. By position matches the first item with the first item and so on. Ignore order treats a list as a collection, so identical items match wherever they sit. Match by key lines up objects by a field such as id, then compares each pair field by field. You can also list keys to ignore, such as updatedAt, and copy a plain text report to paste into a message or ticket.

Cómo usar JSON Diff

  1. Paste the original JSON on the left and the changed JSON on the right.
  2. Choose how lists are compared, and add a key name if matching by key.
  3. List any keys to ignore, separated by commas.
  4. Read the differences, or copy the report.

Usos habituales

  • Checking what changed between two API responses
  • Reviewing a configuration file before and after an edit
  • Comparing exported records from two dates
  • Finding the field that makes two similar documents unequal

Preguntas frecuentes

How do I compare two JSON files?

Paste or open the original on the left and the changed version on the right. The differences appear straight away, each with its path and the old and new values. Use Swap sides to reverse the comparison and Copy report to paste the list somewhere else.

Does the order of keys matter?

No. Objects are compared key by key, so two documents with the same keys and values in a different order are reported as the same. The order of items in a list does matter unless you choose to ignore it, because lists are ordered by nature.

How are lists compared?

By position by default, so item 0 is compared with item 0 and extra items are reported as added or removed. Ignore order matches identical items wherever they appear. Match by key lines up objects that share a key such as id, which suits lists of records.

What do the paths mean?

The dollar sign stands for the whole document. A dot and a name step into an object, and a number in square brackets picks a list item. For example $.users[1].email is the email of the second user. When matching by key the brackets show the key and value, such as [id=7].

Can I hide fields I do not care about?

Yes. Type the key names into the ignore box, separated by commas, and those keys are skipped at every level. This is useful for fields such as updatedAt or requestId that change every time but do not matter for your comparison.