Text Compare: Find Differences Between Two Texts
Text compare: paste the old and the new version – removed text shows struck through with −, added text underlined with +. Nothing is uploaded.
Source: Eugene W. Myers: An O(ND) Difference Algorithm and Its Variations, Algorithmica 1 (1986). Updated: .
How it is calculated
How the text compare works
The tool splits both texts into units – lines, words or characters – and finds the longest common subsequence. Anything only in text A is removed, anything only in text B is added. It uses Eugene W. Myers’ algorithm (1986), the same idea behind diff and Git, which finds the smallest possible number of changes.
How to compare two texts
- Paste the old version on the left and the new one on the right.
- Choose “Compare by”: lines, words or characters; optionally ignore case or whitespace.
- Read the differences: removed text struck through with −, new text underlined with +, plus the similarity in percent.
Example: old “The contract ends on 31 March”, new “The contract ends on 30 April” – in word mode, “31 March” is marked as removed and “30 April” as added.
Similarity score
Similarity = 2 × matching units ÷ (units in A + units in B). Example: “The dog barks” and “The dog sleeps” share 2 of 3 + 3 words → 2 × 2 ÷ 6 = 67%. In word mode, spaces are not counted as words.
Readable without colour
Removed text is wrapped in <del> (struck through, marked −), added text in <ins> (underlined, marked +), so the result also works for colour-blind users, in print and with screen readers. “Differences as text” gives the same result to copy: in line mode with +/− at the start of each line, otherwise in the style [−old−]{+new+}.
Limits
Everything runs in your browser. To keep it fast, each text can have up to 100,000 characters and 20,000 units. With very many changes (over 2,000), the differing middle part is summarised roughly as removed/added – switch to line mode in that case.
More text tools: strip formatting leftovers first with the text cleaner, check the length of both versions with the word counter and create placeholder text with the lorem ipsum generator.
Side by side, jump to the next difference, files and export
- Side-by-side view: text A on the left, text B on the right, both with line numbers. Inside a changed line only the changed word or character is highlighted, depending on “Compare by”. On a phone the two versions are stacked.
- From change to change: “Previous” and “Next difference” jump through the comparison and show which change you are at.
- Files: open text files (such as .txt, .md, .csv, .json or source code) with the buttons or drop them onto a text box. They are read only in your browser. Windows and Unix line endings count as the same.
- Export: “Save as patch” creates a unified diff with three lines of context, the format
diff -u,patchand Git understand. “Save as HTML” stores the highlighted view as a standalone file to share or print.
The link to this page never contains your texts, only the settings.
Frequently asked questions
Are my texts stored or uploaded?
No. Both texts stay in your browser and are not added to the address bar. Only the options (mode, checkboxes) are part of the link.
Which mode should I use?
Lines for lists, code and tables, words for prose such as contracts or articles, characters for single typos, names or numbers.
Why is a changed line shown as removed and added?
A diff only knows insertions and deletions, so a changed line is “old line removed + new line added”. Switch to words or characters to see what changed inside the line.
Can I compare Word or PDF files?
Not directly – copy the text from both documents and paste it into the two boxes. Formatting such as bold or font size is not compared, only the text.
How do I compare two lists?
Paste both lists with one entry per line and choose “lines”: entries only on the left show as removed, new ones as added.
Sources and legal basis
- Eugene W. Myers: An O(ND) Difference Algorithm and Its Variations, Algorithmica 1 (1986)
- WHATWG HTML Living Standard – Edits (ins, del)
- GNU Diffutils Manual (options -i, -b; unified format for the patch export)
As of: · Editorial policy
Related tools
- Word Counter and Character CounterCharacter counter: characters with and without spaces, words, sentences, reading and speaking time, top words – live, with limits for X, Instagram and SMS.
- Compare two listsCompare two lists: see what is only in A, only in B or in both. With case, duplicates and sorting options. In your browser, no upload.
- JSON compareJSON compare: find the differences between two JSON documents with path, old and new value. Key order is ignored. In your browser, no upload.
- Compare PDF FilesCompare PDF files: choose two PDFs and see every text difference highlighted, with a page overview – right in your browser, free and without any upload.
- Hashtag Counter & Instagram Caption FormatterCount hashtags and @mentions, spot duplicate hashtags and clean up your caption: move hashtags to the end and keep line breaks. Free and private.
- Lorem Ipsum GeneratorFree lorem ipsum generator: paragraphs, sentences or an exact word count, start with “Lorem ipsum dolor sit amet”, optional HTML paragraph tags, one-click copy.
- Password GeneratorGenerate secure random passwords and memorable passphrases with entropy shown in bits — calculated right in your browser, nothing sent or stored.
- SRT EditorSRT editor in your browser: paste subtitles, shift them by seconds, convert the frame rate or sync them with two time points, then save as SRT or WebVTT.
- Compare two imagesCompare two images and find the differences: check pixel by pixel, mark changes in red, blend with a slider or view a difference image. No upload, free.