How to use
To use our free online JSON compare tool, just follow these steps:
- Use Copy & Paste or click the
Load Filebuttons to load the data you want to compare
- If the JSON data is difficult to read (e.g. contains no line breaks), click the
You should now see a side-by-side comparison of your JSON objects and arrays. The diff still shows the original data you entered, but the two data sets are now aligned with each other. Red and green highlighting helps you see where the data differs.
Values or keys that are only present in the left data set are highlighted in red while data that is unique to the right data set is highlighted in green.
If there is a lot of overlap between the two versions of your JSON data sets, identical areas are excluded from the diff to help you focus on the actual changes.
Check out our documentation to learn more.
How it works
The tool compares JSON objects and arrays by first parsing them into a data structure that is independent of their textual representation. This helps us ignore changes that are unrelated to the encoded values, such as adding optional commas or whitespace outside of strings.
Additional rules are applied to filter out changes that do not modify the semantics of the values, such as reordering keys within the same object or using a different base to represent an integer literal (e.g. hex/decimal in JSON5).
Afterwards, the remaining changes are mapped back to the text you inserted to highlight the modifications. Unlike most other online JSON diff tools, our tool does not reformat your JSON input. This should help you locate the changes in the original input. If you like, you can still reformat your input using the
Prettify buttons before diffing.
Our online JSON diff tool requires an internet connection to work because the computation is performed on our servers. If you are looking for a semantic JSON comparison that works offline, you may want to check out our SemanticDiff Visual Studio Code extension. It can not only compare JSON files but also supports various other programming languages and data formats. The extension performs all computations locally, so your data never leaves your machine.