Skip to content
DeveloperRuns in your browser

Text Diff Checker

Compare two texts line by line and highlight additions and deletions.

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 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.

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 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, word and character diffs

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.

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.