Text Diff Checker
Compare two texts and see every changed line with the changed words highlighted inside it. Line numbers for both sides, an ignore-trailing-whitespace switch, and exact results at any size — entirely in your browser, so contracts and code never leave your machine.
Reading the output
The result is a unified view: unchanged lines carry both line numbers, removed lines a −, added lines a +. When one line was edited into another, the pair is shown together and the words that differ are highlighted inside each — the line-level diff answers where something changed, the word-level marks answer what.
What "shortest edit script" buys you
A naive comparison lines the texts up from the top and calls everything after the first insertion "changed". Myers' algorithm instead finds the minimal set of edits, so inserting one paragraph near the top shows as exactly that — one added block — with the rest aligned and quiet. That minimality is what makes a diff readable, and it is why the same algorithm runs inside git, which formats its output the same way this page does.
The invisible-difference trap
The classic support question — "the tool says these lines differ but they look identical" — is nearly always whitespace: a trailing space, a tab that renders like spaces, or a non-breaking space carried in from a word processor. The trailing-whitespace switch handles the common case. When lines still differ invisibly, the word-level highlight narrows it to the exact token, which is usually enough to spot a stray character.
Everything runs locally in your browser; neither side of the comparison is sent anywhere.
Frequently asked questions
How does the comparison work?
With Myers' diff algorithm — the one inside git. It finds the shortest sequence of line insertions and deletions that turns one text into the other, so unchanged blocks stay aligned even when material was inserted above them. For each changed pair of lines, a second pass at word level marks what moved inside the line.
Is the diff guaranteed to be complete?
Yes, and it is a tested invariant, not a hope: reading the result's unchanged and removed lines reconstructs the original text exactly, and the unchanged and added lines reconstruct the new one. A diff that quietly dropped a line would be worse than no diff, because people act on what it shows.
Why do I see a change on lines that look the same?
Almost always invisible characters: a trailing space, a tab versus spaces, or a non-breaking space pasted from a word processor. Turn on "Ignore trailing whitespace" to silence the commonest case. Leading indentation is deliberately never ignored — in code and in structured text, indentation is meaning.
Is my text uploaded anywhere?
No. The comparison runs entirely in your browser — nothing is sent to a server, which is the point: the texts people diff are contracts, code and drafts, exactly the things that should not travel. You can load this page, disconnect from the network, and the tool keeps working.
How large a text can it handle?
Ordinary documents and source files — thousands of lines — compare instantly, because the algorithm's cost grows with the amount of difference rather than the text size. Past twenty thousand differing lines the tool switches to marking the whole block as replaced rather than hanging the page; the result is still a valid, complete edit script.
Can I compare two files?
Open each file in any editor and paste its contents into a side. For binary formats — Word documents, PDFs — paste the extracted text; a byte-level comparison of binary files is a different job, and a checksum (see the hash generator) answers the usual question there: whether two files are identical.
Related tools
- Word & Character CounterLive word, character, sentence and paragraph counts, with reading time, keyword density, and whether the text fits a post, a search title or one text message.
- Sort & Dedupe LinesSort, dedupe, shuffle, trim and number lines — natural sort puts file2 before file10 — or compare two lists.
- Lorem Ipsum GeneratorPlaceholder text by paragraphs, sentences or exact word count — starting with the classic line everyone recognizes, shaped like real prose.