Maaz Zindani

Loading the index…

↑↓ move↵ openesc close3993 pages

Free tool · Writing tools

Diff checker: compare two texts

A free diff checker for plain text: paste the original and the changed version and see every difference marked. Nothing you paste leaves your device.

  • Free
  • No sign-up
  • Runs in your browser

By Maaz Zindani · Updated

Compare by
View
Options
Differences
OriginalChanged
1The quick brown fox1The quick red fox
2jumps over the lazy dog2jumps over the sleepy dog
3and runs away.3and runs away.
4The end.

Removed text is struck through on red. Added text is underlined on green.

  • 3 lines added, 2 lines removed
Added
3 lines
Removed
2 lines
Unchanged
1 line
Similarity
29%

How to use the Text Compare

  1. Paste the first version into Original text and the second into Changed text.
  2. Pick Lines, Words or Characters under Compare by.
  3. Choose Side by side or Inline under View, and tick Ignore case or Ignore extra spaces if needed.
  4. Read the marked differences under Differences, then press Copy changes to take them with you.

How do I compare two texts and see the differences?

Put the older text on the left and the newer text on the right. The tool finds the longest run of material the two versions share and treats everything else as an edit: text that only the original has is shown as removed, text that only the new version has is shown as added. This is the same idea as the diff command that programmers use to compare files, and the result does not depend on which version is longer.

In the example already on the page, the original has 3 lines and the changed text has 4 lines. Two lines were edited ("brown" became "red" in the first, "lazy" became "sleepy" in the second), one line is untouched and one line was added at the end. The counts under the result say exactly that: 3 lines added, 2 removed and 1 unchanged, with a similarity of 29 percent. The first two numbers count both halves of an edit, because a changed line is one removal and one addition.

In the side by side view, a removed word is struck through on a red background and an added word is underlined on a green background, so the marks do not rely on color alone. The inline view puts removed and added lines one after the other with a minus or a plus in front, the way a code review shows them. With Copy changes the same example reads - The quick brown fox | + The quick red fox | - jumps over the lazy dog | + jumps over the sleepy dog | and runs away. | + The end., where a minus marks a removed line, a plus marks an added line and unmarked lines are unchanged. Use Swap texts to see the comparison the other way round: the added and removed counts trade places.

Can I compare line by line, word by word or character by character?

Lines is best for lists, code, configuration and any text where the line is the unit. When a removed line and an added line sit next to each other, they are shown as one changed row, and the words that differ inside it are marked, so you do not have to hunt for the one changed word in a long line. Words suits prose: comparing "The quick brown fox" with "The slow brown dog" gives 2 added, 2 removed, 2 shared, 50% similar. With Copy changes the result reads The [-quick-]{+slow+} brown [-fox-]{+dog+}, where [-text-] is removed and {+text+} is added.

Characters goes down to single letters: "kitten" against "sitting" gives 3 added, 2 removed, 4 shared, 62% similar, written as [-k-]{+s+}itt[-e-]{+i+}n{+g+}. It is the right choice for spotting a typo in a name, a number or a code. Spaces are not counted in the character totals, only letters, digits and symbols.

The similarity percentage is twice the shared material divided by the combined size of both texts, in the unit you chose. Identical texts score 100 percent and texts with nothing in common score 0. Because the unit changes what is counted, the same pair of texts can score differently in Words and Characters mode, as the table below shows.

How do I ignore case, spaces and line endings?

Ignore case treats "Hello" and "hello" as the same. Ignore extra spaces collapses runs of spaces and tabs and trims the ends of each line before comparing, so an indented or re-wrapped copy does not light up. Line endings never count: Windows (CRLF) and Unix line breaks compare as equal, and one final line break at the end of a text is not treated as an extra empty line. The table runs the same small pairs with and without each option. Each result column reads added / removed / shared.

Effect of the settings on small examples
CaseTextsSettingAdded / removed / sharedSimilarity
Same text, case differsHello World and hello worldWords2 / 2 / 00%
Same text, case differsHello World and hello worldWords, ignore case0 / 0 / 2100%
Doubled space inside a linea b and a bLines1 / 1 / 00%
Doubled space inside a linea b and a bLines, ignore extra spaces0 / 0 / 1100%
Indented line total: 5 and total: 5Lines1 / 1 / 00%
Indented line total: 5 and total: 5Lines, ignore extra spaces0 / 0 / 1100%
Windows (CRLF) or Unix (LF) line breaksa then b, with each break styleLines0 / 0 / 2100%
One word changedThe quick brown fox and The slow brown dogWords2 / 2 / 250%
One word changedThe quick brown fox and The slow brown dogCharacters6 / 7 / 958%
Spellingkitten and sittingWords1 / 1 / 00%
Spellingkitten and sittingCharacters3 / 2 / 462%

Turn an option on only when the difference does not matter to you. In code, spaces and case often carry meaning, so leave both off and read every mark.

How do I compare two files, and is my text uploaded?

Open each file in any editor, copy its contents and paste them into the two boxes. The tool compares text, so it suits notes, essays, emails, logs, CSV data, code and configuration files. It does not read Word documents, PDFs or spreadsheets directly: copy the text out of them first. For long documents, start with Lines or Words, because the character comparison is limited to 40,000 characters per side. Lines and words allow up to 400,000 characters per side, and the tool tells you when a text is too large instead of freezing the page.

The comparison runs in your browser with a small open-source diff library, so the two texts are never sent to a server. That makes it reasonable for private drafts, but remember that your browser, extensions and clipboard are outside this page. Copy changes gives you the result as plain text: lines are marked with "-" and "+", and words or characters are written as [-removed-] and {+added+}, which you can paste into a message or a ticket.

Use it with

Questions

How do I compare two texts online?

Paste the first text into Original text and the second into Changed text. The differences are marked straight away: removed text is struck through, added text is underlined. The example on the page gives 3 lines added and 2 lines removed. Choose Lines, Words or Characters to set how fine the comparison is.

Can I compare word by word?

Yes. Choose Words under Compare by. Comparing "The quick brown fox" with "The slow brown dog" gives 2 added, 2 removed, 2 shared, 50% similar. Lines and Characters are the other two choices.

Does it ignore whitespace or capital letters?

Both are options. Tick Ignore case to treat upper and lower case as equal, and Ignore extra spaces to collapse repeated spaces and tabs and trim each line. Differences in Windows or Unix line endings are always ignored.

How do I compare two files?

Copy the text of each file from your editor and paste it into the two boxes. The tool compares plain text only, so for Word, PDF or spreadsheet files copy the text out first.

Is my text uploaded anywhere?

No. The comparison runs in your browser, so both texts stay on your device.

What does the similarity percentage mean?

It is twice the amount of shared material divided by the combined size of both texts, counted in the unit you chose. Identical texts score 100 percent and texts with nothing in common score 0. "kitten" against "sitting" in Characters mode scores 62 percent.

How this page was made: the tool's results are computed in your browser by the code on this page; the explanations were drafted with AI help and checked against the tool's own output.