Skip to content
KazamTools

Text Compare

See exactly what changed between two versions, line by line, word by word or letter by letter.

0 lines · 0 characters

0 lines · 0 characters

Lines: each line is compared as a whole, and changed words inside a changed line are highlighted. “Ignore whitespace” ignores spaces at the start and end of a line and treats any run of spaces or tabs as one space.

Paste or type two versions of a text to see what changed.

How to use the Text Compare

  1. 1Paste the original text in the first box and the changed text in the second box.
  2. 2Choose Lines, Words or Characters to set how closely to compare.
  3. 3Tick Ignore case or Ignore whitespace to skip changes you don’t care about.
  4. 4Read the highlighted changes side by side or in the unified view, then copy or download the diff.

How the comparison works

The tool cuts both texts into small pieces: whole lines, single words, or single characters, depending on the mode you pick. It then looks for the longest sequence of pieces that both versions share, in the same order. Everything outside that shared sequence is a change. A piece that exists only in the original was removed. A piece that exists only in the new version was added.

The search uses the Myers diff algorithm (published by Eugene Myers in 1986), the same idea behind git diff. It finds the smallest set of additions and removals that turns the first text into the second. Because nothing is guessed, the counts always add up:

unchanged + removed = pieces in the original
unchanged + added = pieces in the changed text

A “changed” line is simply a removed line and an added line shown next to each other. Inside such a pair, the tool runs a second, word-level comparison, so you can see exactly which words differ instead of re-reading the whole line.

Worked example: words versus characters

Original: The quick brown fox jumps over the lazy dog. Changed: The quick red fox jumped over the lazy dog.

In Words mode the result is +2 added, −2 removed, 8 unchanged words. “brown” became “red” and “jumps” became “jumped”. The full stop counts as its own word, which is why there are 8 unchanged words, not 7.

In Characters mode the same pair gives +4 added, −5 removed, 39 unchanged characters. The tool keeps the “r” of “brown” because “red” also contains an “r”, and it keeps “jump” because only the ending changed. Character mode is precise, but for whole-word edits it can look busy. That is why Words is usually the better choice for prose.

Worked example: a list in Lines mode

Suppose a shopping list changes from apples, bread, milk, eggs (one item per line) to apples, brown bread, milk, butter, eggs. Lines mode reports +2 added, −1 removed, 3 unchanged lines: “bread” was replaced by “brown bread”, and “butter” is new. The downloadable .diff file for this change looks like this:

--- original.txt
+++ changed.txt
@@ -1,4 +1,5 @@
 apples
-bread
+brown bread
 milk
+butter
 eggs

Lines starting with a space are unchanged context, - means removed and + means added. The @@ line says the change starts at line 1 and covers 4 lines of the old text and 5 lines of the new one.

Which mode should you use?

Mode Best for Typical change it reveals
Lines Code, CSV files, settings, lists A line added to a config file
Words Essays, contracts, articles, emails “may” changed to “must” in a clause
Characters Typos, IDs, short strings, hidden symbols “recieve” corrected to “receive”

What the ignore options do

  • Ignore case treats “Hello” and “hello” as the same in every mode.
  • Ignore whitespace depends on the mode. In Lines mode it ignores spaces at the start and end of a line and treats a run of spaces or tabs as one space. In Words mode, extra spaces and line breaks between words never count. In Characters mode, any run of spaces, tabs and line breaks counts as a single space.

The ignore options only change what is highlighted. The .diff file you copy or download always describes the exact texts, so it can be applied with git apply or patch without surprises.

Windows (CRLF) and Mac or Linux (LF) line endings are always treated as the same, so a file saved on a different computer does not show every line as changed.

Reading the result

Side by side puts the original on the left and the new version on the right, with line numbers on both sides. Unified shows one column, like a patch: removed lines first, then the lines that replaced them. On a phone the unified view is used by default because it fits a narrow screen.

Turn on Show only changes for long documents. Long stretches of unchanged text shrink to a single bar, and 3 lines of context stay around each change, just like in a code review. Click a bar to open it again.

Tips for cleaner comparisons

  • Comparing JSON? Run both versions through the JSON formatter first, with the same indentation and with keys sorted. Then only real changes remain, not formatting noise.
  • Text copied from Word or a PDF often hides curly quotes (’ instead of ’) or non-breaking spaces. If two lines look the same but are marked as different, switch to Characters mode to find the culprit.
  • Only need to know if two files are identical? Compare their checksums with the hash generator. The same SHA-256 hash means the same content.
  • Checking a rewrite against a length limit? Paste the new version into the word counter.

Privacy

The comparison runs entirely in your browser, inside a background worker, so typing stays smooth even with very long texts. Nothing you paste is uploaded, logged or stored. Only your display settings (mode and options) are remembered in this browser.

Cite this tool

Using this tool in an essay, report or article? Copy a ready-made reference. Check your teacher's or publisher's style guide for small differences.

APA
KazamTools. (2026, October 21). Text compare. Retrieved October 30, 2026, from https://kazamtools.com/text/text-compare/
MLA
"Text Compare." KazamTools, 21 Oct. 2026, https://kazamtools.com/text/text-compare/. Accessed 30 Oct. 2026.
Chicago
KazamTools. "Text Compare." Last modified October 21, 2026. Accessed October 30, 2026. https://kazamtools.com/text/text-compare/.
Plain link
Text Compare (KazamTools): https://kazamtools.com/text/text-compare/
HTML link
<a href="https://kazamtools.com/text/text-compare/">Text compare</a> by KazamTools

Frequently asked questions

How do I compare two texts for differences?

Paste the original version in the first box and the new version in the second. Added text is highlighted in green and removed text in red a moment after you stop typing.

What is the difference between Lines, Words and Characters?

Lines treats each line as one unit, which suits code, lists and settings files. Words finds changed words inside sentences, which suits essays and contracts. Characters shows single-letter edits such as typos.

Is my text uploaded anywhere?

No. The comparison runs in your browser in a background worker, so your text is never sent to a server or stored. You can even go offline after the page loads.

Can I ignore changes in spaces or capital letters?

Yes. Ignore whitespace skips extra spaces and tabs, and Ignore case treats “Hello” and “hello” as the same. The downloadable .diff file always reflects the exact texts.

How large can the texts be?

Tens of thousands of lines compare in well under a second. If two very large texts are completely different, Words or Characters mode can take too long; Lines mode is then the fastest choice.

What is a unified diff?

It is the standard patch format used by git and other tools. Removed lines start with a minus sign and added lines with a plus sign, with a few unchanged lines around each change for context.

Guides

Was this tool helpful?