diffcompare textsversion controlgit

How to Compare Two Texts and See the Differences (diff)

What a diff is, how to compare two texts or file versions to see what changed, and what it's used for in programming and document review. Free diff online.

June 21, 2026·5 min read

Comparing two versions of a text to see exactly what changed is an everyday task: reviewing a contract, finding the difference between two configs, or seeing what was modified in some code. The tool for that is called a diff. This guide explains what it is and how to use it.

What is a diff

A diff (from difference) is a comparison that shows the differences between two texts. Instead of reading both in full looking for changes by eye, a diff highlights them automatically: which lines were added, which removed and which modified.

It's the basis of version control (Git), code reviews and any process where it matters to know "what changed between version A and B."

How a diff is displayed

The usual way is to see the two texts side by side or one above the other, with colors:

  • Green / +: lines added in the new version.
  • Red / -: lines removed from the original.
  • No color: lines that didn't change (context).

Some diffs are finer and highlight the changes within a line (which specific words or characters changed), which helps spot small modifications.

What a diff is used for

In programming

  • Review changes before committing them in Git.
  • Code review: see what a teammate modified in a pull request.
  • Debug: compare a working version with a broken one.
  • Detect accidental changes in config 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 on one side.
  2. Paste the modified text on the other.
  3. The tool instantly highlights what was added, removed and changed.

You can do it free with the diff checker on this site, which compares everything in your browser: your texts aren't uploaded to any server (important if you compare private documents).

Types of comparison

  • By line: the most common; compares line by line. Ideal for code and configs.
  • By word: highlights the words that change within each line. Better for prose text.
  • By character: the finest; useful for tiny changes.

Frequently asked questions

What's the difference between diff and merge? The diff shows the differences; the merge combines two versions resolving those differences. Git uses both.

Can I compare large files? Yes, though the longer they are, the longer the computation takes. For normal texts it's instant.

Is it good for comparing code? It's one of its main uses. It highlights each added or removed line.

Are my texts uploaded when comparing them? No, if you use a local tool. Everything happens in your browser.


Compare two texts and see the differences instantly with the free diff checker, 100% 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