Text Diff Checker

Compare two texts line by line and see exactly what was added and removed — colour-blind-safe markup with + and − signs, all in your browser. Free, no sign-up — runs locally in your browser.

Your work is auto-saved in this browser only, so a refresh won't lose it. Nothing is uploaded.

What a line diff tells you

Two versions of a text always raise the same question — what actually changed? — and reading both in full to answer it is the slowest possible method. A diff answers it mechanically: align the two texts by the lines they share, and whatever is left over is the change. Lines that only exist in the original are removals; lines that only exist in the new version are additions; everything else is context that stayed put. That is the whole model — the same one behind git diff, code review tools and Wikipedia's history view — reduced here to two paste boxes and one button, for the config file, contract clause or config snippet you need compared once, not committed anywhere.

How to use this tool

  1. Paste the earlier version on the left and the newer version on the right. Order matters: the left is "before", so lines only on the left read as removals.
  2. Press Compare. The result lists every line of both texts in aligned order, with the changes marked.
  3. Read the marks, not just the colours: a + in a blue-tinted row is an added line, a − in a grey row is a removed line, and unmarked rows are unchanged context. The summary above the result counts each kind.
  4. An edited line appears as a removal immediately followed by its replacement as an addition — that pairing is how a line diff says "this line changed".
  5. Swap sides flips the comparison when you realise the versions are in the wrong order; additions and removals trade places, as they should.

Why signs and words, not just colours

The classic diff palette — red for deletions, green for additions — encodes the entire meaning of the output in the one channel about 8% of men and 0.5% of women cannot reliably distinguish. This page treats colour as decoration and puts the meaning elsewhere: the + and − signs in the gutter, the words Added and Removed in the legend, the line numbers from each side (a removed line has a left number and no right number; an added line the reverse), and two background shades — a blue tint for additions, a neutral grey for removals — chosen to differ in lightness, so the output survives being printed in greyscale. It is a small design decision with a large property: nobody has to guess what a row means.

Reading a diff well

Start with the shape, not the details. A healthy edit is a few tight clusters of change in a sea of unchanged lines; long runs of pure removals followed by pure additions usually mean a block was moved or re-wrapped rather than rewritten, and a diff where every line changed almost always means the invisible things changed — line endings, indentation character, encoding — rather than the words. This checker normalises line endings for exactly that reason, but it will not hide a tabs-to-spaces conversion, because sometimes that conversion is the change you are hunting. Finally, remember what a diff cannot say: it shows that line 12 changed, never whether the change is right. The alignment is mechanical; the judgement stays yours.

Frequently asked questions

How does this page decide what changed?

It compares the two texts line by line and finds the longest sequence of lines they share in order (a longest-common-subsequence diff, the same family of algorithm Git uses before its refinements). Lines in that shared sequence are unchanged; lines only in the left text are removals, lines only in the right text are additions. A line that was edited shows up as one removal plus one addition — this is a line diff, not a word diff, so it will not paint half a line.

Why don't you use red and green like everyone else?

Because roughly one man in twelve has red-green colour vision deficiency, and to them the standard diff palette is two shades of maybe. Here, added lines get a blue tint and a + sign; removed lines get a grey tint and a − sign, with the words Added and Removed spelled out in the legend. Colour is the third signal, never the only one — the distinction survives a greyscale screenshot, a projector, and colour-blind eyes.

My files differ only in line endings or a trailing newline. Will that show?

Line endings will not: CRLF and lone CR are normalised to LF before comparing, precisely so a file saved on Windows does not report itself as entirely changed. A trailing newline at the very end is likewise treated as terminating the last line, not as an extra empty line. Differences in spaces or tabs inside a line are real differences and are reported — this checker compares literally and does not trim anything.

Is there a size limit?

Yes, an honest one. The comparison table grows with the product of the two line counts, so inputs whose combined size would exceed about 25 million table cells (for example 5,000 × 5,000 lines) are refused with an explanation instead of freezing your tab. Two pasted config files, scripts or articles are far below that. For comparing whole repositories, use git diff — it is the same idea with forty years of optimisation behind it.

Are the two texts uploaded for comparison?

No. The comparison runs in your browser, and the two drafts are kept only as local browser drafts like the other tools here, so you can paste sensitive material — a config with internal hostnames, an unreleased draft — without it leaving your machine.

Related tools