How to compare JSON
Diffline shows every difference between two JSON documents, down to the single value that changed. Here is how to get the clearest result:
- Add both versions. Paste the original JSON into the left box and the new JSON into the right box, or click Open file to load two .json files.
- Click Format JSON. Both sides are rewritten with the same two space indent. Minified JSON on one line, tabs or four space indents no longer show up as changes.
- Tick Sort keys if order does not matter. Objects are rewritten with their keys in alphabetical order, at every level. Two objects with the same keys in a different order become identical. Arrays keep their order, because the order of a list usually means something.
- Read the result. Removed lines are red, added lines are green, and changed values are highlighted inside the line, so a version bump from 1.4.2 to 1.4.3 stands out at once.
Tip: if Format JSON reports an error, the message names the box with the problem. Trailing commas, single quotes and comments are the usual causes, since strict JSON does not allow them.
What you can compare
API responses
Compare the response from staging with production, or from before and after a deploy, to see which fields changed, appeared or went missing.
package.json and dependencies
Spot exactly which packages were added, removed or bumped between two versions of a project.
Config files
Settings such as tsconfig.json, ESLint or app configuration often break because of one changed value. Format both files and the line that matters stands out.
Translation files
Compare en.json with another language file using Sort keys to find keys that are missing or extra in one of them.
Test fixtures and data exports
Check snapshots, fixtures or database exports after a change to confirm that only the records you expected were touched.
Why your JSON stays private
JSON often holds API keys, access tokens, customer records or internal settings. Many online JSON tools send what you paste to their servers. Diffline does not: formatting and comparing both run inside the page, on your own device, so your JSON is never uploaded, stored or logged.
Formatting is exact as well. Plain JavaScript rounds numbers with more than about 15 digits, which can silently change 64 bit IDs. Diffline keeps the digits from your original JSON, so an ID that looks different really is different. You can read more in our Privacy Policy, or compare plain text instead.
Frequently asked questions
How do I compare two JSON files online?
Paste the original JSON into the left box and the new JSON into the right box, or open the two .json files. Click Format JSON so both sides use the same layout, then read the result: removed lines are red, added lines are green, and changed values are highlighted inside the line.
Does key order matter when comparing JSON?
For most JSON it does not: an object with the same keys in a different order holds the same data. Tick Sort keys before you click Format JSON and both sides are rewritten with their keys in alphabetical order, so only real changes show. Arrays keep their order, because order in a list usually matters.
Why do two JSON files look different when the data is the same?
Usually it is only the layout: one file is minified on a single line, the other is indented with tabs or four spaces, or the keys are in a different order. Format JSON with Sort keys removes all of these differences, so the comparison shows only values that really changed.
What happens if my JSON is invalid?
Diffline leaves your text exactly as it is and tells you which box has the problem, with the message from the JSON parser, for example a missing quote or a trailing comma. You can still compare invalid JSON as plain text without formatting it.
Is it safe to paste JSON with API keys or personal data?
Yes. Formatting and comparing both happen inside your browser. Your JSON is never uploaded, stored or logged, so tokens, keys and customer records stay on your device. Closing the tab removes it.
Will large numbers or IDs change when I format the JSON?
No. Many tools round big numbers such as 64 bit IDs because JavaScript numbers lose precision after 15 digits. Diffline keeps the exact digits from your original JSON when it formats, so an ID like 12345678901234567890 stays exactly the same.