Text Diff Checker

Compare two blocks of text line by line with a side-by-side colored diff. Free, fast, and your text never leaves your device.

Original text

Changed text

Added Removed

Spotting what changed between two versions

Paste the earlier text on the left, the later text on the right, and press Compare. The result is shown as two aligned columns with line numbers: lines that were taken out are tinted red on the left, lines that were put in are tinted green on the right, and unchanged lines sit level with each other so your eye can follow a single row across. Above the columns a short summary counts additions, removals and the change in total lines.

Situations where that is genuinely quicker than reading twice:

  • A client returns a quote or a scope of works and says they only tweaked a couple of clauses. The diff shows whether that is true.
  • You are comparing a working nginx or .env configuration against one that has stopped behaving, and a single changed line is hiding in eighty.
  • An editor sends back a blog post as plain text and you want the exact sentences that moved.

The algorithm, without the jargon

Both sides are cut into lines, then the code fills a table of longest common subsequence lengths. Every cell answers one question: starting from line i on the left and line j on the right, how many lines can still be matched up in order? The table is filled from the bottom right corner backwards, then the code walks forward from the top. If the two current lines are identical it marks them equal and steps both sides on. If not, it looks at the two neighbouring cells and sacrifices whichever side loses the least future matching, marking that line as a removal or an addition. The effect is that the tool keeps the largest possible set of matching lines aligned, and only reports the leftovers. This is the same idea behind the diff in Git, although production implementations add refinements this one lacks.

Worked example

Put apple / banana / cherry on three lines in the left box, and apple / blueberry / cherry / date on four lines in the right. Compare, and the summary reads: 2 line(s) added, 1 line(s) removed, 3 to 4 total lines. Line 1 and the cherry line stay plain in both columns. The banana line is red on the left with an empty slot opposite it, blueberry is green on the right with an empty slot opposite, and date is green on the right at the bottom.

Where it will struggle, and what it does not do

The comparison is whole lines only. Change one word in a 200 character paragraph and the entire paragraph is shown as removed and re-added, with no highlighting of the changed word inside it. It is also strictly literal: a trailing space, a tab instead of four spaces, or a capital letter makes two lines count as different, and there is no option to ignore case or whitespace. Windows line endings are converted first, so mixing CRLF and LF sources is fine. A text ending in a newline produces one final empty line, which is why totals sometimes read one higher than expected.

Memory is the real ceiling. The table holds four bytes for every pair of lines, so 1,000 lines against 1,000 lines needs about 4 MB and runs instantly, 5,000 against 5,000 needs roughly 100 MB and will feel slow, and 20,000 against 20,000 asks for more than a gigabyte and will simply fail in most browsers. For anything of that size, a desktop diff program is the better answer. There is also no file picker, no syntax highlighting and no three way merge. Everything happens in your browser and nothing is uploaded to a server. Using the comparison costs nothing, and when the credit on your device runs down a brief rewarded ad covers the next run.

Tools that pair well with this one

Two JSON files are far easier to compare after both have been through JSON Formatter, which puts them on consistent lines. The same trick works for XML and JSON Converter output and for spreadsheet data run through CSV to JSON. If you only want to know whether two files are byte for byte identical, a checksum from Hash Generator answers that in one step. For counting rather than comparing, see Word Counter and Word Frequency Counter. Mismatched capitalisation can be normalised first with Case Converter, encoded payloads decoded with Base64 Encode and Decode, and prose checked for clarity using Readability Checker.

Frequently asked

Does it highlight the exact words that changed?

No. The comparison works on whole lines, so a single altered word marks the entire line as removed and added again. Splitting long paragraphs onto shorter lines before pasting makes the output easier to read.

Does it ignore spacing or capital letters?

No. Two lines count as the same only if they match character for character, including trailing spaces, tabs and case. Tidy the text first if those differences do not matter to you.

How much text can it handle?

Comfortably a few thousand lines on each side. The comparison table grows with the number of lines on one side multiplied by the number on the other, so very large files can exhaust the memory your browser allows and fail.

What does the swap button do?

It exchanges the contents of the two boxes so you can look at the change from the other direction. It does not re-run the comparison, so press Compare again afterwards.

Is anything I paste sent away?

No. The comparison is carried out by JavaScript on the page itself, so drafts, contracts and source code stay on your machine.