Compare Two JSON Files

Compare two JSON files by a key field and see which records were added, removed or changed, down to the nested field. Free, in your browser.

Quick answer: Compare two datasets and see what was added, removed or changed.

Related: Data Comparison (CSV and Excel Diff) · Compare Two CSV Files · Compare Two Excel Files · Compare Two Parquet Files · JSON Guides and Free JSON Tools

How to use the Compare Two JSON Files

Compare two datasets and see what was added, removed or changed.

Data Comparison shows exactly what changed between two versions of a file. Pick a key column, or use the first column or the first two columns, and it lists rows that were added, removed or changed, down to the cell. Use it to check an export against last month, to review a data migration, or to find which values a script changed. CSV, Excel, JSON, Parquet and Avro are supported, and the two files can be different formats.

  1. Load dataset A and B
  2. Pick or type the key column
  3. Review and download the differences

Tips

Records, not lines

This compares the data in two JSON files record by record, not line by line. A list of objects becomes a table with one row per object, you choose a key field such as id, and the tool tells you which records were added, removed or changed. Reordering the records, or changing the indentation, does not count as a change.

Nested objects are flattened into columns, so a change inside a record is reported as that field, for example address.city. Arrays are compared as a whole value.

When to use something else

If you want to see the exact lines that changed in a configuration file, a text diff is the right tool. If your JSON is a list of records, such as an API response or an export, comparing by key is clearer. JSON can also be compared with a CSV, Excel, Parquet or Avro file.

Example

Input: old.json + new.json, key = id

Output: Added 3 · Removed 2 · Changed 5 (address.city)

Browse by topic

Who uses Data Utility

Frequently asked questions · Data format benchmark

Frequently asked questions

How do I compare two JSON files?

Load both files, choose a key field such as id and read the added, removed and changed records. Nested objects are flattened into columns like address.city, so a change deep inside a record is shown as that field.

Does it work for a JSON array of objects?

Yes. A JSON file that is a list of objects, or a single object, is read as a table with one row per object. To diff two JSON documents line by line, a text diff tool is a better fit.

Can I compare JSON with CSV or Parquet?

Yes. Any two supported formats can be compared, for example an API response saved as JSON against a CSV export.

Which file formats can I compare?

CSV, TSV, Excel (.xlsx), JSON, Parquet and Avro, in any combination. For example, compare a Parquet file with the CSV it was made from. Nested JSON and Avro fields are flattened into columns such as address.city.

Will 10 in a CSV match 10 in a Parquet file?

Yes. Values are compared by meaning, not by how they are written: 10 equals 10.0, true equals "true", and a date equals the same date in any format. A value only counts as changed if it really differs.

Can Data Comparison do change data capture (CDC)?

It does the snapshot version of CDC for files. Compare the earlier and the latest export by key: added rows are inserts, changed rows are updates and removed rows are deletes. It does not read database logs or run in real time.

How does Data Comparison find differences?

It matches rows by a key column, or by the first two columns, and shows which rows were added, removed or changed, down to the cell. It works with CSV and Excel files.

Related pages

Topic guides

Guides