~ / text / text-compare

🔍 Text Compare (Diff Checker)

Paste the original and the revised version to see exactly what was added, removed or changed — line by line, with the changed words highlighted. Ideal for contracts, drafts and config files.

options
Compare
Highlight within lines by
View
Display
diff

How to compare two texts

  1. Paste the original (older version) into A on the left and the revised version into B on the right. The comparison updates as you type.
  2. In the result, red lines exist only in A (removed) and green lines are new in B (added). When only part of a line changed, just those characters or words are highlighted more strongly.
  3. For long documents, turn on Only show changes to see three lines of context around each change. Click a folded section to expand it.
  4. copy gives you the diff as plain text with + and - in front of each line, ready to paste into an email, Slack or a ticket.

Options

OptionWhat it doesWhen to use it
Ignore whitespaceIgnores differences in spaces, tabs and trailing spacesCode where only indentation changed; drafts where only spacing was fixed
Ignore caseTreats Apple and apple as equalLists, keywords and SQL where capitalization doesn't matter
Character / WordHighlights differences inside changed lines character by character or word by wordCharacter for typos and numbers; word for edited prose
Side by side / UnifiedShows A and B in two columns, or one column with −/+ lines like gitSide by side on desktop, unified on phones (the default on small screens)

Reading the numbers

How the diff works (LCS and the Myers algorithm)

The longest list of lines that appears in both texts, in the same order, is called the longest common subsequence (LCS). Lines from A that aren't in the LCS are removals; lines from B that aren't are additions. This tool uses the Myers diff algorithm — the same one behind git and most diff programs — to find the smallest set of removals and additions, then runs it again on the characters or words inside each changed line.

Myers is fastest when the texts are similar, so comparing two versions of the same document finishes almost instantly even at tens of thousands of lines. Two completely different texts take much more work, so once the difference exceeds 3,000 lines the tool aligns only the matching lines at the start and end and shows the middle as removed and added. Each side accepts up to 300,000 characters and 20,000 lines.

When to use it

Because the comparison is line by line, moving a paragraph shows up as a removal plus an addition, and re-wrapping a paragraph at different points marks several lines as changed. Normalize the line breaks first with the line break remover. Your texts are compared entirely in your browser and are never uploaded or saved.

FAQ

Can I compare Word documents or PDFs?
You can't upload files, but you can open each document, select all the text, copy it and paste it here. Formatting and tables are dropped and only the text is compared. To compare formatting changes too, use Word's Review → Compare feature.
Is my text sent to a server?
No. The comparison runs entirely in your browser with JavaScript, and nothing you paste is uploaded or stored — so it is safe for contracts and other sensitive documents.
Only one line changed, but several lines are marked. Why?
The line breaks probably moved. Text copied from PDFs or chat apps is wrapped at different points, so the same sentence ends up on different lines. Clean both texts with the line break remover first. If only spacing differs, turn on "Ignore whitespace".
How long can the texts be?
Up to 300,000 characters and 20,000 lines per side. Similar versions of a document compare quickly at that size; completely different texts switch to a simplified view once the difference exceeds 3,000 lines.
What format does the copy button use?
Unchanged lines start with two spaces, removed lines with "- " and added lines with "+ " — similar to a git diff, so it pastes cleanly into emails, chat and issue trackers.

Related tools