Text Compare (Diff Checker): Find the Differences

Put the old version in the first box and the new version in the second. Added and removed lines are labeled and colored, and the totals update as you type.

TextFreeNo sign-upWorks on phones
––
–Lines added
–Lines removed
–Lines unchanged
–Similarity
Line-by-line comparison
The two numbers are the line in the original and the line in the changed text.
Plain-text version (+ added, – removed)

This tool runs in your browser. Nothing you type is uploaded or saved, and there is nothing to install or sign up for.

Spot what changed between two versions

Two drafts of an essay, two exports of a class list, last week’s instructions and this week’s: reading both side by side to find the edits is tiring and unreliable. A diff checker does that comparison mechanically. It lines the two texts up, works out which lines they share, and labels everything else as added or removed.

This checker compares whole lines. It is at its best with lists, code, data rows, notes and any writing where each line or paragraph is a unit.

How to compare two texts

  1. Paste the earlier version into Original text.
  2. Paste the later version into Changed text.
  3. Read the headline for the totals, then scroll through the comparison. Each row carries a text label, + Added, – Removed or = Same, as well as a color, so it stays readable in grayscale or for anyone who cannot tell red from green.
  4. Tick Ignore capital letters, Ignore spaces at line ends or Ignore empty lines if those differences do not matter to you.
  5. Use Copy comparison to take the plain-text version with you. Swap the two texts flips the direction, and Reset restores the sample.

Worked example: a shopping list with two edits

The page opens with a five-line shopping list as the original: Milk, Eggs, Bread, Butter, Apples. The changed list has six lines: Milk, Eggs, Brown bread, Butter, Apples, Coffee.

The result is 2 lines added, 1 line removed, with 4 lines unchanged:

Original lineChanged lineStatusText
11SameMilk
22SameEggs
3–RemovedBread
–3AddedBrown bread
44SameButter
55SameApples
–6AddedCoffee

Notice that editing Bread into Brown bread shows up as one removal plus one addition. A line that is altered in any way is a different line as far as the comparison is concerned. The similarity tile reads 72.7%, and the next section shows where that figure comes from.

Press Swap and the same pair reads the other way round: 1 line added, 2 lines removed.

The method: longest common subsequence

The checker looks for the longest run of lines that appear in both texts in the same order, not necessarily next to each other. Computer scientists call this the longest common subsequence, or LCS. In the shopping lists it is Milk, Eggs, Butter, Apples, four lines long.

Every line in that shared sequence is marked Same. Lines of the original that are not in it are Removed. Lines of the changed text that are not in it are Added. Choosing the longest shared sequence keeps the number of reported changes as small as possible.

How similarity is calculated

similarity = 2 x unchanged lines / (lines in original + lines in changed) x 100

For the example that is 2 × 4 ÷ (5 + 6) = 8 ÷ 11, which rounds to 72.7%. Identical texts score 100% and texts with no line in common score 0%. Treat it as a quick measure of overlap by line, not as a plagiarism score.

Reading the result correctly

  • Moved lines. A line that moves to a new position is listed as removed from the old place and added at the new one. Comparing 1, 2, 3 with 3, 1, 2 reports 3 as added on top and removed at the bottom.
  • Small edits inside a long paragraph. A paragraph typed as one line is one unit, so a single changed comma marks the whole paragraph. Put each sentence on its own line first for a finer view.
  • Invisible differences. A trailing space or a capital letter makes two lines unequal. If a pair looks the same but is flagged, tick the two ignore boxes and see whether the flag disappears.
  • Different line wrapping. If one version has hard returns inside paragraphs and the other does not, almost everything will differ. Run both through the line break remover before comparing.

Limits: 100,000 characters and 2,000 lines per side. Comparisons longer than 500 rows list only the changed lines, up to the first 500, while the counts still cover everything.

Where a line comparison helps

Students can check what a study partner changed in shared notes, or compare a draft with the version that came back from peer review. Teachers can compare two exports of a roster to see who joined or left a class, or check an answer key against a revised one. Sorting both lists with the line sorter first means a change in order alone will not be reported.

For office and coding work, compare two copies of a configuration file, a list of web addresses before and after a clean-up, or the result of a bulk edit made with the find and replace tool. If the lists contain repeats, the duplicate line remover makes them easier to match up.

See the other text tools for more ways to clean and reshape writing, or look through all of the free online tools for something else.

Frequently asked questions

How do I compare two texts for differences?

Paste the first version into the Original box and the second into the Changed box. Lines found only in the second are labeled Added, lines found only in the first are labeled Removed, and shared lines are labeled Same.

What does the similarity percentage mean?

It is twice the number of unchanged lines divided by the total lines on both sides. The shopping-list example has 4 unchanged lines out of 5 and 6, so the score is 8 divided by 11, or 72.7 percent.

Why is an edited line shown as removed and added?

The comparison works on whole lines. Changing even one character makes the old line and the new line different, so the old one is listed as removed and the new one as added.

Can it ignore differences in capital letters or spacing?

Yes. Tick Ignore capital letters to treat Milk and milk as equal, and Ignore spaces at line ends to skip leading and trailing spaces. A third box leaves empty lines out of the comparison.

Does the diff checker show changes inside a line?

No. It reports which lines differ but does not highlight the individual words or characters. Splitting long paragraphs into one sentence per line gives a more detailed result.

How much text can I compare?

Each side can hold up to 100,000 characters and 2,000 lines. Very long comparisons list only the changed lines, but the added, removed and unchanged totals always count every line.

Related tools

Browse all free tools →