Compare Two Texts

Paste an old version and a new one and get the lines that changed, with the changed words marked inside them, so a clause that went from thirty days to sixty days shows you those two numbers rather than the whole paragraph. Identical stretches collapse out of the way. It uses the same algorithm as git and every code editor, and unlike most comparison tools it splits words using the dictionary your browser already carries, which is the only way to get Thai, Japanese and Chinese right. Nothing is uploaded: both texts stay in the tab.

What changed

Paste both texts to compare them.

Frequently asked questions

Why do other comparison tools get Thai wrong?

Because they split words on spaces, and Thai does not put spaces between words. A whole sentence is one word to that kind of tool, so changing one syllable marks the entire line as changed and you are back to reading both versions yourself. This one asks the browser to segment the text, using the same dictionary it uses to select a word when you double-click, so a Thai sentence is compared word by word. Japanese and Chinese work for the same reason.

Is my text uploaded?

No. The comparison runs in this tab. The site’s security policy sets connect-src ‘none’, so the browser blocks network requests from these pages, so neither version could be sent even if the code tried. That is the point for anyone comparing two drafts of a contract, a policy or an unreleased announcement.

What does edited mean, as opposed to added and removed?

A line that changed arrives from the algorithm as one deletion and one insertion. When the two are similar enough to be the same line rewritten, they are shown as one row with the words compared inside it. When they are not similar, they are shown separately, because pairing two unrelated lines produces a word comparison that highlights everything and tells you nothing.

Why is most of my document hidden?

Because it did not change. Unchanged runs collapse to a line saying how many were hidden, with three lines of context kept either side of every change, so the differences are the thing on the screen rather than something to scroll for. Tick the box for showing unchanged lines if you want it all.

It says the texts have too little in common. What does that mean?

The method finds the shortest set of edits that turns one text into the other, and its cost grows with the number of differences. Past a stated limit the two texts do not really correspond to each other, and any line-up would be an invented one, so it says so and reports the block as replaced instead of guessing or freezing your tab.

Can it compare two files rather than pasted text?

Not yet. Opening files here would mean deciding what to do with encodings, and there is already a tool on this site for working out what a file is written in. For now, open the files and paste.