Compare text
About this tool
Paste into either side, or drop a file onto it. The comparison runs as you type and shows what changed line by line, then character by character within the lines that changed. A removal immediately followed by an addition is paired into a single changed row rather than shown twice.
The divider between the two panes can be dragged with the mouse or nudged with the arrow keys when it has focus, and where you leave it is remembered.
How it works
The diff engine is a hand-written longest-common-subsequence implementation, with the common prefix and suffix trimmed off first so that large files with small edits stay fast. Above roughly four million comparison cells it stops and falls back to a plain list of additions and removals rather than hanging the tab. There is no library behind it and nothing to keep updated.
Common questions
Can I compare two files rather than pasting?
Yes. Drop a file onto either pane, or use the Load file button above it. Both sides accept either method, and you can mix them — a pasted block on one side and a dropped file on the other.
Is my text uploaded anywhere?
No. The comparison happens in your browser. There is no fetch, no beacon and no logging, and the page carries no third-party scripts of any kind.
How large a file can it handle?
Large ones, within reason. The guard rail trips at about four million comparison cells — roughly two thousand distinct lines against two thousand — and below that a full character-level diff is produced. Above it you still get a usable add and remove listing.
Can I compare two folders?
Not yet. Folder comparison needs a browser API that only Chrome and Edge on desktop support, which would leave most visitors unable to use it. It is on the list, waiting for a workable fallback.
When a comparison looks wrong
Every line shows as changed
Almost always line endings. A file written on Windows ends its lines with a carriage return and a line feed (CRLF); one written on macOS or Linux uses a line feed alone (LF). The characters differ, so every line differs. Git's core.autocrlf setting is the usual culprit when the same file looks different on two machines.
Two lines look identical but are marked as changed
Trailing whitespace, or a non-breaking space that was pasted in from a web page or a word processor. Both are invisible on screen and both are real characters. The character-level view narrows it down — a change marked at the very end of an otherwise identical line is trailing whitespace.
The comparison stops being character-level on a big file
That is the guard rail, not a fault. Above roughly four million comparison cells the character-level pass is abandoned and a plain addition and removal listing is produced instead, so the tab stays responsive. Compare a smaller section if you need the detail.
A dropped file shows as gibberish
The file is not text. Anything binary — an image, a PDF, a compiled executable — has no lines to compare and will render as replacement characters. Files that are text but not UTF-8 can also mis-render; save as UTF-8 first.
Indentation differences swamp the real change
A reformat mixed in with an edit produces a diff where every line moved. Reformat and edit as two separate steps if you can, and compare each separately.
The same job at the command line
Nothing here is trying to replace these. They are faster when the files are already on your machine, and this page is faster when one side is pasted from somewhere else.
diff -u original.txt changed.txtUnified diff, the format patches use.git diff --no-index original.txt changed.txtGit's diff on two files that are not in a repository. Better word-level highlighting than plaindiff.diff -w -B original.txt changed.txtIgnore whitespace changes and blank lines — the quickest way to confirm a difference is only formatting.
More tools
See the whole toolbox — thirty-seven free tools planned, all running in your browser.