Skip to content
DeveloperRuns in your browser

Text Diff Checker

Compare two texts line by line and highlight additions and deletions with this text diff checker.

Input
No upload needed — instant
Privacy
Nothing is uploaded
Cost
Free · no sign-up · no watermark

Loading tool…

The tool is loading its code on your device. This happens once and is cached for later visits.

Processed entirely on your device

Everything you type or paste is handled by JavaScript running in this tab. No request is sent, nothing is logged and nothing is stored. Close the page and it is gone.

Overview

About the Text Diff Checker

Compare two blocks of text online with a line-by-line diff. Additions, deletions and unchanged lines are colour-coded and counted, computed in your browser with no upload.

A text diff answers one question: what changed between two versions of a text? It is the operation behind every code review, every merge conflict and every moment of wondering what you edited an hour ago. Doing it by eye across two documents is slow and unreliable, especially once the change is small and buried in a large file — which is exactly what a diff checker exists to prevent.

This text diff checker compares two blocks line by line, colour-codes additions and deletions, counts what changed, and shows both line-number columns so you can trace any change back to its source. The comparison runs on the longest-common-subsequence algorithm — the same idea behind git diff — computed entirely in your browser.

Longest common subsequence

The standard approach finds the longest common subsequence — the largest set of lines that appear in both versions in the same relative order, though not necessarily next to each other. Every line in that subsequence is unchanged; lines present only on the left are deletions and lines present only on the right are additions. It is the same idea git uses, and it produces the minimal-looking edit script people expect from a diff.

Reading the diff output

ColourMarkerMeaning
GreenplusA line added on the right
RedminusA line removed from the left
NeutralnoneA line identical on both sides

The two number columns are the line's position in the left and right documents, so you can jump back to the original when a change matters. The summary counts at the top tell you the size of the change at a glance, which is frequently the only thing you needed to know.

Why large inputs need care

An exact longest-common-subsequence comparison builds a table whose size is the product of the two line counts, which grows fast. To stay responsive this diff first peels away the shared prefix and suffix — the unchanged head and tail that most real edits have — and only runs the quadratic core on the genuinely different middle. If that middle is still enormous it falls back to presenting the block as a wholesale replacement and says so, rather than hanging the browser.

Line diff, word diff and character diff

Diffs can operate at different granularities. A line diff, which is what this is, treats each line as an atomic unit and is the convention for source code and prose. A word or character diff highlights the exact span that changed inside a line, which is nicer for legal text and copy editing but noisier for code. Line-level output is the best general default, and it is what version control shows you.

What a text diff checker is for

The everyday cases rarely involve source control: comparing two versions of a contract clause, checking whether a CMS export really changed, verifying a migration script rewrote a config the way it claimed, reviewing a translated document against the original, or settling "I only changed one thing" with evidence. A text comparison tool answers each in seconds. Paste the original on the left, the new version on the right, press compare, and read the coloured lines — the count summary at the top is often the entire answer.

Comparing text online without uploading it

The texts people compare are frequently the texts people must protect: contracts, unpublished copy, internal configs, credentials that leaked into a log. This diff checker computes everything locally in the tab — no upload, no server-side comparison, no retention. That is not a small detail for a text comparison tool; it is the difference between a safe utility and a data leak wearing a utility's clothes.

Diff checker tips

  • Normalise whitespace first if you do not care about it — trailing spaces count as changes here, because the comparison is exact.
  • Trim shared boilerplate — long identical headers make the useful change harder to see; compare the parts that differ.
  • Re-compare after each edit — the diff is instant, so verifying a fix costs one click.
  • Watch the counts — "3 added, 1 removed" is often all the confirmation a change needs.

Diff checker, compare tool, merge tool — which do you need?

A diff checker tells you what changed. A compare tool is the same thing under another name. A merge tool goes further: it helps you combine two changed versions into one, resolving conflicts as you go. This tool is deliberately the first kind — paste two texts, see the difference, no repository required. When you need three-way merges, blame annotations and history, that is version control's job; when you need to know whether two texts differ and where, a text diff is the whole answer.

Step by step

How to use the Text Diff Checker

  1. Paste the original text into the left panel and the changed version into the right.

  2. Press Compare to run the line-by-line diff.

  3. Read the colour-coded result: green lines were added, red lines were removed.

  4. Check the added, removed and unchanged counts, then adjust and compare again.

Why use it

Benefits and common use cases

What this tool is good for, and what it deliberately does not try to do.

Colour-coded line diff

Additions, deletions and unchanged lines are visually distinct with left and right line numbers, so you can see exactly what moved rather than hunting through two documents.

Counts up front

The number of added, removed and unchanged lines is summarised at the top, which is often the whole answer when you just need to know how big a change was.

Handles large inputs safely

Shared prefix and suffix lines are peeled off first and an oversized changed block falls back to a wholesale replace, so a big paste never freezes the tab.

Private comparison

Contracts, configs and source code are compared in your browser, so sensitive text is never transmitted to a server.

Questions

Frequently asked questions

Short, honest answers about quality, limits and privacy.

How is a diff computed?

This tool compares line by line using a longest-common-subsequence algorithm, the same idea behind git diff. It finds the largest set of lines that appear in both versions in the same order and marks everything else as an addition or a deletion.

Does it compare words or characters within a line?

The comparison is line-based, so a line with one changed word shows as one deletion and one addition rather than a word-level highlight. That matches how version control and most diff tools present changes and keeps the output easy to scan.

Why are some lines shown as a full replace?

For very large inputs the exact longest-common-subsequence table would be too big to build on the main thread, so the differing middle is shown as a wholesale replacement of the old block by the new one. A notice tells you when this fallback was used.

Is whitespace significant?

Yes. Two lines that differ only by trailing spaces or indentation count as changed, because the comparison is exact. If you want to ignore whitespace, normalise both sides first with a text-cleaning tool and then compare.

Can I diff code or configuration files?

Absolutely — paste the text of two files and compare. For source code a dedicated version-control diff with syntax awareness is richer, but for a quick before-and-after check on a config, a contract clause or a snippet, a line diff is the fastest route.