Text tool

Text Diff Checker

Paste an original and a changed version to find different lines locally.

Runs in your browser. No upload.

Comparison runs locally line by line.

Differences0
No comparison yet.

About this tool

Text Diff Checker made simple.

Useful for comparing drafts, code, configuration files and copied documents without uploading either version.

Guide

Using Text Diff Checker

This page compares two pieces of text and lists the lines that are different. You paste the first version in the left box and the second version in the right box, then press the Compare button. Two tick boxes let you ignore spaces at the start and end of each line, and ignore capital letters. It helps when you edit a draft, check a settings file, or look at two copies of a list. It judges whole lines only. It does not point to the changed words inside a line, open files, or merge two versions into one. The texts are compared on your device.

How to use it

  1. Paste the older or first version into the box called Original text.
  2. Paste the newer or second version into the box called Changed text.
  3. Tick Trim spaces if extra spaces at the start or end of a line, or repeated spaces between words, should not count as a change. Tick Ignore case if capital letters should not count.
  4. Press Compare text. The Differences number shows how many lines differ, and the list below shows each one.
  5. Read each entry. It starts with a line number, then a line that begins with a minus sign for the original and a line that begins with a plus sign for the changed text.
  6. If you edit a box or a tick box, the old result is cleared. Press Compare text again to see an updated list. Press Clear to empty both boxes.

Worked examples

One line was replaced

You enter
Original
apples bananas cherries
Changed
apples blueberries cherries
You get
Differences
1
List
Line 2: - bananas + blueberries

The first and third lines match. Only the second line differs, so there is one difference, shown with the old line after the minus and the new line after the plus.

Run through the tool’s own code.

A new line added at the top

You enter
Original
a b c d
Changed
x a b c d
You get
Differences
1
List
Line 1: - (empty) + x

The page matches the unchanged lines first, so the four old lines are not all reported as changed. Only the new line x is listed, and (empty) means the original has no line there.

Run through the tool’s own code.

Ignore case switched on and off

You enter
Original
Name: Ana City: Lyon
Changed
name: ana city: LYON
You get
With ignore case
0
Without ignore case
2

The two versions differ only in capital letters. With Ignore case ticked they count as the same, and with it off both lines are listed as different.

Run through the tool’s own code.

Spaces at the ends and spaces inside

You enter
Original
hello there world
Changed
hello there world
Trim spaces
yes
You get
Differences
0

Trim spaces removes spaces at the start and end of each line and turns repeated spaces or tabs between words into one space. With the box unticked, the same two texts show 1 difference.

Run through the tool’s own code.

One line becomes three lines

You enter
Original
a b c
Changed
a X Y Z c
You get
Differences
3
List
Line 2: - b + X Line 3: - (empty) + Y Line 4: - (empty) + Z

One old line was swapped for three new ones. The count is the larger side of the change, which is three. The extra lines are paired with (empty) and numbered after line 2.

Run through the tool’s own code.

A hidden empty line at the end

You enter
Original
a b
Changed
a b
You get
Differences
1
List
Line 3: - (empty) + (empty)

A final line break creates an empty third line in the original. Both sides show (empty), which looks odd, but the real difference is that the original has one more empty line.

Run through the tool’s own code.

When it helps

  • Compare two drafts of an email, an essay or a post to see which lines you rewrote.
  • Check a copied settings file or a short code snippet against the version you started with.
  • Find the line that changed between two versions of a list, such as names, prices or tasks.
  • Confirm that a pasted copy of a document matches the original, line by line.
  • Check whether two exports of the same data are the same after you clean them up.
  • Review changes in a lesson plan or a script before you send the new version to others.

Limits to keep in mind

  • Only whole lines are compared. If one word changes in a long line, the whole line is listed, and the changed word is not highlighted.
  • The line number refers to the original text. For a line that was only added, it shows the place where it would go, which can be past the last original line.
  • Trim spaces removes spaces and tabs at the start and end of each line and turns repeated spaces or tabs between words into one space. Different kinds of quote mark or dash still count as changes.
  • The word (empty) is used for both a missing line and a real empty line, so a difference between those two cases can be hard to tell apart.
  • Very large or very different texts can take too long. After a couple of seconds of work, the page stops and asks you to compare smaller sections.
  • You cannot open a file here. Paste the text into the boxes, and the page cannot merge, save or export the result.

Tips

  • Split long documents into sections and compare them one at a time. This is faster and the list is easier to read.
  • If two texts look the same but show a difference, check for a final empty line, extra spaces, tabs, or a different kind of apostrophe or quote mark.
  • Windows and Mac or Linux line endings are treated as the same, so a copy from another system does not show false differences.
  • Use Ignore case when comparing names or labels typed by different people, and leave it off when capitals matter, as in code.
  • Put the older text on the left and the newer on the right every time, so minus always means removed and plus always means added.
  • Press Compare text again after you change a box or a tick box, because the old result is cleared as soon as you edit.

Sources

Common questions

About Text Diff Checker.

How do I compare two versions of a text?

Paste the first version into Original text and the second into Changed text. Choose the Trim spaces or Ignore case options if you need them, then press Compare text. The page shows how many lines differ and lists them one by one.

Does it show which words changed inside a line?

No. It compares whole lines. If a single word is different, the full old line and the full new line are shown, and you need to spot the changed word yourself. It does not mark letters or words within a line.

If I add a line in the middle, does everything below it show as changed?

No. The page lines up the matching lines before it reports changes, so one added line gives one difference. It uses a standard shortest-edit method called the Myers algorithm, in a code library named jsdiff.

What does the number after Line mean?

It is the line number in the original text where the change starts. For lines that were only added, it is the place in the original where they would be inserted, so the number can be higher than the number of original lines.

Why does it say (empty)?

The word (empty) fills the empty side of a pair. If a line was added, the original side shows (empty). If a line was deleted, the changed side shows it. It is also shown for a real blank line.

Does Trim spaces ignore all extra spaces?

It ignores spaces and tabs at the start and end of each line, and it treats a run of spaces or tabs between words as one space. It does not remove blank lines and it does not make different quote marks or dashes equal.

How does Ignore case treat letters like ß?

It turns both lines to lower case using the rules of the page language before it compares. Because of that, Straße and STRASSE still count as different: the first becomes straße and the second becomes strasse.

Why do two texts that look the same show a difference?

Common causes are a blank line at the end, spaces at the end of a line, tabs instead of spaces, or curly quotes in place of straight ones. Tick Trim spaces to remove the effect of extra spaces and tabs at the ends of lines and between words; a blank line at the end still counts.

Is there a limit on the size of the texts?

There is no fixed length. The work is done in the background, and if it takes more than a couple of seconds the page stops and asks you to try smaller sections. Texts that are very different from each other take longest.

Are my texts uploaded?

No. The comparison runs in your browser, in a background worker on your device, and neither text is sent to a server. The status line on the page says that the comparison runs locally.

Can I compare two files or merge two versions?

The page has no file picker, so you paste the text instead. It also has no merge or save function. It only lists the lines that differ, and you apply the changes yourself in your editor.

How do I compare two text files or drafts?

Paste the original text into the first box, the revised text into the second, choose optional comparison rules, then select Compare text.

How are differences displayed?

The checker compares lines in order and shows the original and changed version of each differing line. It does not perform a word-by-word alignment.