difftool.fr

Text comparison · free · nothing uploaded

Compare code online

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 versions of a source file, a configuration or a script: difftool.fr compares them line by line, numbers every line and highlights the changed words inside modified lines. Your code stays on your machine — which matters for proprietary code or a configuration that contains secrets.

Reading a code diff

  • Removed lines are marked with a − on a red background, added lines with a + on a blue background.
  • In a changed line, only the words that differ are highlighted: an added parameter or a renamed variable stands out at once.
  • Each side keeps its own line numbers, as in an editor.
  • The Unified view shows the result in a single column, the familiar git diff layout: removed lines, then added lines.

For a long file, tick “Hide identical lines”: only the changed blocks remain, with three lines of context, as in a code review.

Syntax highlighting

Code is highlighted (keywords, strings, numbers, comments…) in both views, on top of the diff highlighting. The language is detected automatically from the file extension or the pasted content; plain prose is never highlighted. The “Highlighting” setting lets you force a language or turn highlighting off. Supported: JavaScript, TypeScript, JSON, Python, PHP, SQL, HTML and XML, CSS, YAML, Bash, Java, C#, C, C++, Go and Ruby.

Ignoring indentation

A change of indentation (tabs replaced by spaces, a shifted block) can make whole lines look modified. Tick “Ignore leading and trailing spaces” to see only real changes, or “all whitespace” if the formatting changed inside lines.

Exporting a patch

“Copy diff” and “Download .diff” produce a diff in unified format. It applies with the patch command:

patch original-file.js < original-file.diff

The diff is exact to the character, including for a file without a final newline, even when ignore options are ticked on screen.

Frequently asked questions

Is my code sent to a server?

No. The comparison runs in your browser, in a process separate from the page. No network request is made while comparing: you can even go offline once the page has loaded.

Which languages are supported?

All of them: the tool compares text, whatever the language. Syntax highlighting is available for JavaScript, TypeScript, JSON, Python, PHP, SQL, HTML/XML, CSS, YAML, Bash, Java, C#, C, C++, Go and Ruby.

Does the .diff file work with patch?

Yes. The file follows the unified format: patch original.txt < original.diff gives back the changed version exactly. The headers use the names of the opened files.

How fast is it on large files?

Two files of 10,000 lines are compared in under a second, and only the visible lines are drawn, so scrolling stays smooth even on very long files.

Can I ignore indentation changes?

Yes: tick “Ignore leading and trailing spaces”. A line that was only re-indented is then considered identical.