Compare two versions · Free

Text Diff Checker

Compare two versions of a text and see every line added, removed or changed, with the changed words highlighted inside edited lines. Ignore case, whitespace or blank lines, switch between side-by-side and unified views, and copy a unified patch. Each side takes up to 200,000 characters or 10,000 lines, and the comparison runs in your browser.

Compared in your browser · Nothing uploaded
Report a problem

Text comparison workspace

Both panes are empty. Paste a version into each side to compare them.

Compare desk

Paste the two versions

Old on the left, new on the right. Both stay in this tab: the text is never uploaded or kept anywhere.

0 lines · 0 words · 0 chars
0 lines · 0 words · 0 chars
Detail inside a changed line
Pair lines when they are

A removed line and an added line are only compared inside each other above 0.30 shared characters.

Treat as equal

These change what counts as equal, never what is shown. Every character on screen and in the copied patch is exactly the one you pasted.

No differences
n/a

Paste a version into each pane and the comparison appears here.

Lines added
0
Lines removed
0
Lines changed
0
Lines untouched
0
Words added
0
Words removed
0
Chars added
0
Chars removed
0
The comparison

Side by side, in matched gutters

Additions carry a plus and an underline, deletions a minus and a strikethrough, so the result survives being printed in black and white or read without colour.

Both panes are empty. Paste an earlier version on the left and a newer one on the right, or press Load a sample to see a pair of release notes carrying every kind of change at once: three reworded lines, one rewritten line, a new line, a new blank line, and a trailing space you would never spot by eye until you turn on Show invisibles.

Unified patch

The same comparison, as a patch

Real hunk headers, context lines either side, and hunks merged when they sit close together. These are the conventions git and GNU diff use.

A unified patch appears here as soon as there is something to describe.

A moved block appears twice

The edit script has two verbs, delete and insert; there is no move. Relocating a paragraph is spelled as its disappearance here and its arrival there, which is why one action produces two blocks of colour.

Shortest is not unique

Comparing “a b c” with “a c b” has two equally short answers, and every tool picks one by convention. When a diff blames a line you did not touch, it has usually chosen a different account of the same change.

Whitespace is sometimes the whole point

Ignoring spacing is right for prose and reformatted code. It is wrong for Python, YAML, and Makefiles, where indentation and a literal tab are syntax. There, a whitespace-only change is the change.

Both texts stay in this tab. The comparison is plain JavaScript running on your own machine: the text is never uploaded or sent anywhere, and no copy is stored, so a contract, a draft, or a config file with a key in it is as safe here as it is in your editor. Each side takes up to 200,000 characters or 10,000 lines; past the search limits a region is reported as one block replaced by another and the page says so rather than pretending the answer is minimal.

How it works

Two texts, and the cheapest story that connects them.

A diff is not a list of differences; it is the shortest set of deletions and insertions that turns the first text into the second. That is a real distinction. It explains why a moved paragraph appears twice, why an edited line is technically a removal standing next to an addition, and why two different tools can disagree about the same change and both be right. This page runs Myers' algorithm over the lines, refines each changed pair inside itself, and shows its working, including the moments it had to settle for a coarser answer.

  1. 01

    Paste both versions

    Paste the original on the left and the revised version on the right, or load the sample. If they are the wrong way round, swap the sides. Both texts are compared in your browser and are not uploaded.

  2. 02

    Choose what counts as a difference

    Treat case, all whitespace, leading and trailing spaces or blank lines as equal, and choose Line, Word or Character detail for changed lines. These options change what is compared, never the text you pasted.

  3. 03

    Read the result or copy the patch

    Read the changes side by side or unified, with counts of the lines and words added and removed and a similarity score. Then copy the unified patch with up to 10 lines of context.

Built for drafts, contracts, configs, and code review

Minimal edit scripts, word-level detail, and a patch that actually applies.

A shortest edit script, not a first guess

The comparison is Myers' algorithm, which finds a script of minimum length rather than the first plausible alignment, so moving one sentence does not cascade into every following line being reported as changed. Common openings and endings are stripped before the search even starts, which is why a one-word edit in a long document resolves instantly.

Two levels, so one word reads as one word

Lines are compared first, then a removed line sitting against an added line is compared again inside itself. Change “Tuesday” to “Thursday” and you get one word highlighted, not a whole paragraph struck through. That second pass is gated on how alike the two lines are, so genuinely unrelated lines are not forced into a false pairing.

Options that change the comparison, never your characters

Ignoring case or whitespace works by comparing normalised copies while displaying the originals. Every character on screen and in the copied patch is exactly what you pasted: no line is silently trimmed, lowercased, or re-indented on the way through.

A unified patch with real hunk headers

The patch pane emits proper `@@ -a,b +c,d @@` headers with a configurable number of context lines, hunks merged when they sit close together, and a count of one written without its comma. These are the same conventions git and GNU diff use, so the output pastes straight into a review.

Numbers with the formula attached

Lines added, removed, changed, and untouched; words and characters gained and lost; and a similarity percentage that states how it was reached rather than asking you to trust it. The statistics are always measured at word level, so switching how a changed line is drawn never moves them.

It degrades where it would otherwise hang

Comparing two texts with nothing in common is quadratic work, so both the edit distance and the total search effort are capped. Past the cap a region is reported as one block replaced by another (still correct, no longer minimal), and the page says that happened rather than quietly serving a worse answer.

Diff questions

Moved blocks, invisible line endings, and what the @@ line is telling you.

How do I compare two texts for differences?+

Paste the older version into Original and the newer one into Revised; the comparison updates as you type. Removed lines carry a minus and a strikethrough, added lines a plus and an underline, and when an edited line is close enough to its old version, only the words that changed are highlighted.

Can I compare two Word documents or PDFs?+

Yes, by pasting their text. The checker compares plain text, not files, so copy the text out of each document and paste one into each pane. Fonts, bold and layout are not compared. Text copied from a PDF may wrap lines in different places, which shows up as changed lines, so copy both versions the same way.

Is my text uploaded or saved anywhere?+

No. The comparison runs as JavaScript in this tab, so a contract, a draft or a config file with a key in it is not uploaded, and the page does not store either text. Clearing the panes or closing the tab discards both.

Why does a moved paragraph show up as deleted and added?+

A diff has only two operations, delete and insert, so moving a block appears as its removal from the old position and its arrival at the new one. This checker does not detect moves. To keep a review readable, move the section in one revision and reword it in the next.

Why do two texts that look identical show differences?+

Usually invisible characters: trailing spaces, tabs instead of spaces, or a non-breaking space pasted from a web page. Turn on Show invisibles to see spaces and tabs, or treat whitespace as equal. Different line endings (Windows CRLF against Unix LF) do not create false changes here; the page only notes that they differ.

When should I ignore whitespace?+

Ignore it for prose or reformatted code, where re-indenting or trailing spaces would flood the result. Keep it where spacing is syntax, such as Python and YAML indentation or Makefile tabs. Leading & trailing space forgives only the ends of each line and still reports indentation; All whitespace forgives every space and tab.

What does the @@ line in the unified patch mean?+

It is a hunk header that tells a patch program where the block belongs. @@ -12,7 +12,9 @@ means seven lines from line 12 of the original and nine from line 12 of the revision, counting unchanged context lines. Below it, a space marks an unchanged line, a minus a removed one and a plus an added one.

How long can the two texts be?+

Each side takes up to 200,000 characters or 10,000 lines, roughly a 40,000-word manuscript. If the texts differ by more than 12,000 line edits or the search reaches its effort limit, a region is shown as one block replaced by another and the page says so. The result is still correct, only less detailed.

More focused tools, ready when you are.

Explore the growing collection for calculations, documents, writing, and everyday work.

Browse all tools