diffcompare textsversion controlgit

Compare Two Texts and See the Differences (diff)

What a diff is and how to compare two texts line by line with the free diff checker, with an example of the output. Your texts never leave your browser.

June 21, 2026·3 min read

Comparing two versions of a text to see what changed is an everyday task: reviewing a contract, checking two configs, or seeing what was modified in some code. The diff checker on this site makes that comparison line by line in your browser. What it shows is called a diff: the lines added, the lines removed and the lines that stayed the same.

What is a diff

A diff compares two texts line by line and marks the differences. Instead of reading both in full looking for changes by eye, the modified lines are highlighted.

It is the basis of version control. Git uses git diff to show what changed before you save a change, and code reviews rely on the same principle.

How a diff is displayed

  • Green, with +: lines added in the modified version.
  • Red, with -: lines removed from the original.
  • No colour: lines that did not change.

In the checker, each row shows the line number in the original and in the modified text, and you can hide them with the line numbers switch. The tool compares whole lines: if a single word changes inside a line, that line appears as one removed line and one added line.

This is what the result looks like when comparing two versions of a contract:

--- a/original.txt
+++ b/modified.txt
@@ -1,3 +1,4 @@
-Plazo de entrega: 30 días
+Plazo de entrega: 15 días
 Precio: 120 €
 Garantía: 2 años
+Soporte: 24 h

The Copy diff and Download .diff buttons produce this format, which is the GNU unified diff format. Lines with a leading space did not change and serve as context.

What a diff is used for

In programming

  • Review changes before saving them (commit) in Git.
  • Code review: see what a teammate changed in a pull request.
  • Debugging: compare a version that works with one that doesn't.
  • Catch accidental changes in configuration files.

Outside programming

  • Review contracts or documents: see which clauses changed between two versions.
  • Compare translated or edited texts.
  • Find differences between two lists, exports or records.

How to compare two texts

  1. Paste the original text into the first field.
  2. Paste the modified text into the second.
  3. The result appears as you type, with the count of added, removed and unchanged lines.

Frequently asked questions

What's the difference between diff and merge? A diff shows the differences, and a merge combines two versions by resolving those differences. Git has both commands, git diff and git merge. To see how they fit into branch work, read rebase vs merge in Git.

Can I compare large files? Up to 5,000 lines per text. If either text goes over that limit, the checker shows a warning and does not compute the diff.

Can it compare JSON? Yes, but the text checker compares the text as it is. To compare the structure of two JSON documents by path, use the JSON diff tool.

Are my texts uploaded when I compare them? No. The differences are calculated in your browser and the text is not sent to any server, so you can use it with private documents or code.


Compare two texts and see their differences with the free diff checker. Everything happens in your browser.

Try it without code

Diff Checker

Line-by-line text differences.

Open Diff Checker

Built by

Miguel Ángel Colorado Marin (MACM)

Full-Stack Developer · Guadalajara, España

I develop web apps, digital tools and full projects — from design to deployment.

Contact me