difftool.fr

Text comparison · free · nothing uploaded

Compare two JSON files

Your texts stay on your computer. Nothing is uploaded.

Format
CSV
Compare
View
Ignore
Identical lines

Paste or drop two texts: their differences will appear here.

Paste two JSON documents, or drop two .json files: difftool.fr reformats them and sorts their keys before comparing. A moved key, different indentation or JSON minified on a single line no longer counts: only real content changes appear. API responses, configuration files, data exports: nothing is uploaded, everything happens in your browser.

What the JSON format does

On this page the “JSON” format is on by default. It also turns on as soon as you open a .json file on the other pages. Before comparing, each document is:

  • reformatted, with one key per line and two-space indentation;
  • sorted: the keys of every object are put in alphabetical order, at every level. The order of array items is kept, because it usually matters.

Values are kept exactly as written: a large numeric ID is never rounded, and 1.0 stays 1.0. A key that appears twice in the same object stays visible twice, instead of being silently dropped as many tools do.

Line numbers in the result refer to the reformatted JSON. To compare the exact text you pasted, choose the “Text” format.

Invalid JSON?

If one of the documents is not valid JSON, difftool.fr shows where the error is (line, column and offending character) and compares the raw text instead. Handy for spotting a stray comma or a missing quote.

Reading the result

A changed value appears as a modified line, with the old value struck through on the left and the new one underlined on the right. An added key is a blue line, a removed key a red line. Jump between differences with “Previous” and “Next”, or Alt+↑ and Alt+↓.

Frequently asked questions

Does key order matter?

No, in JSON format: keys are sorted on both sides before comparing, so two objects with the same keys and values in a different order are identical. The order of array items, however, does matter.

My JSON is on a single line. What should I do?

Nothing special: in JSON format it is reformatted automatically, one key per line, before being compared.

Is my data sent anywhere?

No. The JSON is parsed and compared in your browser, without being sent to any server. You can compare API responses that contain personal data or access tokens without exposing them.

Does the tool check that the JSON is valid?

Yes: if there is a syntax error, it shows the line and column, then compares the raw text of both documents.

Are numbers changed?

No. They are copied exactly as written, without conversion: no rounding of large integers, and 1.0 is not rewritten as 1. Two different spellings of the same number therefore show up as a difference.

Can I compare YAML or XML?

Yes, in “Text” format: .yml, .xml and .ini files open and compare line by line, without reformatting.