BrowserTools

Text Diff Checker

Compare two texts, line-by-line differences

By Guga — BrowserTools maintainer, Tbilisi, Georgia Updated 2026-09-21
Free Private No uploads
What is Text Diff Checker?

Two documents go in, one comparison comes out: a single column where added lines carry a plus sign, removed lines a minus, and untouched lines neither. Underneath the two input boxes, three figures give the shape of the change before you read any of it. The comparison is done properly rather than positionally. Matching lines at the start and end are stripped first, then what remains is resolved with a longest-common-subsequence pass, so a single line inserted at the top does not make every line below it look changed. That step is quadratic, so for anything large — either side past two thousand lines, or a large number of lines in total — it is skipped in favour of a faster positional comparison, which can report more differences than are strictly necessary. Comparison is by whole line, exactly, with no whitespace tolerance.

Compare two blocks of text and see added, removed and unchanged lines highlighted side by side. Great for checking edits between document versions, contracts or code snippets.

Private Text Diff Checker In Your Browser

Text Diff Checker is processed locally with client-side JavaScript. Your files never touch a server, and there is no queue to wait in.

Step-by-Step

How to use Text Diff Checker

1

Paste the earlier version into Original text and the later one into Changed text.

2

Read the three counters: lines added, lines removed and unchanged.

3

Scan the column below, where each entry is prefixed with + for an addition, − for a removal and a blank for a match.

4

Check the tail of both documents if the counts look odd — a trailing newline creates an extra empty line.

Key Capabilities
  • Line-level added, removed and unchanged marking in one readable column
  • Sequence-aware comparison after shared prefixes and suffixes are trimmed
  • Automatic fallback to a faster method once the inputs get large
  • Three counters summarising the change before you read the detail
Common Use Cases
  • An editor checking a revised contract against the version a client signed.
  • A developer comparing a local configuration file with the one on a server before deploying.
  • A student reviewing feedback by pasting two drafts and reading only what moved.
Clear Answers

Frequently Asked Questions

Why is the whole rest of the file showing as changed?
Because the inputs are not identical in a way the comparison can absorb. An extra blank line near the top shifts nothing, since matching is sequence-aware, but a changed line ending, a smart quote instead of a straight one or a trailing space will make those exact lines differ. There is no whitespace-ignoring mode, so the comparison is exact by design.
Does it compare words or characters within a line?
Neither. The comparison is line by line, and a modified line is reported as a removal and an addition rather than as a word-level change. For prose where only a few words moved, a word-level diff would be more informative, but that is a different tool.
Why does my last line look changed when nothing is?
A document that ends with a newline splits into an extra empty line that the other version does not have, and an empty line counts as a change. Remove the trailing newline from one side and the counts settle. Editors differ on whether to add one automatically, which is why this comes up so often.
How large can the inputs be?
Large enough for most documents. The accurate method is used until either side passes two thousand lines or the two sides together exceed a million line pairs, after which a faster line-by-line comparison takes over. That fallback stays responsive but can mark a line as changed when an equivalent line has merely moved, so read it as guidance rather than proof for very large files.