Skip to content

Compare two blocks of text and see what changed

Paste the old text on the left and the new text on the right, press Compare, and every added, removed and rewritten line comes back marked. Where a line was rewritten rather than replaced, the words that actually changed are highlighted inside it, so you are not left reading two near-identical lines side by side trying to spot the difference yourself.

In your browser

Compare two blocks of text

Paste the old version on the left and the new one on the right. The comparison itself runs on your own machine, in a background thread of this tab, which is worth knowing if what you are about to paste is a config file, a contract or somebody else’s code.

Nothing you paste here is uploaded. The whole tool runs inside this tab, on your machine.

Text diff, step by step

  1. Paste both versionsThe old text goes in the left box and the new one in the right. Anything that is text will do, whether that is a config file, a contract, minutes, code, or a paragraph rewritten four times.
  2. Set the two toggles if you need themIgnore whitespace treats a reindented line as unchanged, which is what you usually want when a formatter has been through a file. Ignore case does the same for capitalisation.
  3. Read the resultAdded lines are green, removed lines are pink, and a rewritten line shows both versions with the changed words picked out. Switch to one column if the side by side layout is tight.
What it actually does

Myers' difference algorithm, run twice, in a background thread

The comparison is Myers' 1986 difference algorithm, the one git and every serious diff tool uses. It runs twice: once over the lines to work out which were added, removed or kept, and then again over the words inside each pair of lines that changed, which is where the highlighting inside a line comes from. The implementation is the linear space version, so memory does not grow with how different the two sides are, and it happens inside a Web Worker rather than on the page's own thread. That is the difference between a big paste taking a moment and a big paste freezing the tab with no way to stop it. The comparison itself is done by your own machine, which is worth knowing before you paste a config file into a website.

Most free diff pages are a text box and an advert. They compare line by line, which means a line where one number changed comes back as a line deleted and a line added, and you are back to reading two near-identical lines and finding the difference yourself. That is the job you came to have done.

This one does the word level pass as well, which costs nothing once the line pass has told it which lines to look at. It is the same algorithm both times, run over words instead of lines.

The other half of the problem is what people are actually diffing. Config files with credentials in them. Contracts. Code from work. Minutes of a meeting that has not happened publicly yet. All of it routinely gets pasted into whichever diff site came up first, and most of them are a server that receives your text and then tells you about it. This page does the comparison on your own machine, in a thread of the tab you are already looking at, which seems like the obvious way round for a job that never needed a server in the first place.

Questions

Does it highlight changes inside a line, or only whole lines?

Inside a line. When a line has been rewritten rather than replaced outright, the tool runs a second pass over the words in it and marks only the ones that changed. Line level only output is the reason most free diff pages are frustrating to use.

How much text can it handle?

Up to twelve thousand lines or a million characters a side. Past that it says so and names the number rather than appearing to hang, because two very large and very different pastes take longer than anyone is willing to wait for in a browser tab.

What does the ignore whitespace toggle actually do?

It collapses runs of spaces and tabs and trims the ends of each line before comparing, so a file that has been reindented or had trailing spaces stripped reads as unchanged. The text you see is still exactly what you pasted.

Is my text sent anywhere?

Not by this tool. The comparison is done by your own machine, in a background thread of this page, and nothing you paste is included in any request it makes. The page around it is an ordinary web page, and it loads and measures itself like one.

The tool is free. So is the thought.

This page did one small job. Edmund is for the thing you thought of while doing it: a capture app for iPhone, iPad and Mac that files a note the moment you have it, so it does not get lost between having it and writing it down.

See what Edmund does