Text Diff

Find exactly what changed between two drafts, contract versions, configuration files or code snippets. Differences are highlighted down to the individual word, with no upload required.

How to use Text Diff

  1. Paste the original text on the left and the changed text on the right.
  2. Choose to compare by lines (best for code and lists) or by words (best for prose).
  3. Switch between side-by-side and inline views; optionally ignore case or whitespace changes.
  4. Copy or download the result as a unified diff to share or apply as a patch.

About this tool

The comparison uses Eugene Myers’ O(ND) difference algorithm – the same approach behind git diff and GNU diff – to find the smallest set of insertions and deletions that turns one text into the other. Lines that were edited rather than added or removed are paired up and compared word by word, so a one-word change in a long paragraph is easy to spot.

Long stretches of unchanged lines are folded so you can focus on the changes, with three lines of context around each one. “Ignore whitespace changes” treats differences in indentation and spacing as equal, which is handy when code was re-indented; “Ignore case” does the same for capitalisation.

The unified diff export uses the standard format with @@ hunk headers, which can be read by code review tools and applied with patch or git apply.

Frequently asked questions

Is there a size limit?

Texts of tens of thousands of lines compare quickly. If two very large texts are almost completely different, the middle section is shown as one replaced block to keep your browser responsive.

Can I compare Word or PDF documents?

Copy the text out of each document and paste it here. For PDFs, our PDF to Text tool extracts the text first.

Should I compare by lines or by words?

Lines suit code, data and lists, where each line is a unit. Words suit paragraphs of prose, where one edited sentence would otherwise mark the whole paragraph as changed.

Are my texts uploaded to a server?

No. The whole process runs inside your browser with JavaScript. Your texts never leave your device, which also means the tool keeps working if you go offline after the page has loaded.

Is this tool really free?

Yes. There is no sign-up, no daily limit, no watermark and no paid tier. The site is supported by advertising shown on the page, not by charging for the tools.