Home / Text & Writing / Text Diff Checker
08.04Text & Writing

Text Diff Checker

Compare two versions of any text or code with this free text diff checker. See every addition and deletion side by side or inline, line by line or word by word, without uploading anything.

Updated

What a text diff checker does

A text diff checker takes two versions of a document and shows exactly what changed between them: which lines were added, which were removed, and which words were edited inside a line. It is the same idea as the green and red view in a GitHub pull request, without needing a repository. Paste a contract before and after a client's edits, two copies of a config file, last month's homepage copy and this month's, or two exports of a database table, and the differences jump out in seconds.

How to compare two texts

  1. Add both versions. Paste the original on the left and the changed version on the right, or open a file into each side.
  2. Pick a view. Side by side lines the two versions up in columns; Inline shows one merged column with - and + markers, like a unified diff.
  3. Pick a granularity. Line diff marks changed lines and still highlights the edited words inside each one. Word diff treats changed blocks as flowing text, which reads better for paragraphs.
  4. Filter out noise. Ignore whitespace and Ignore case hide changes that do not matter, and long runs of identical lines collapse so you only scroll through the changes. Click a collapsed bar to expand it.

Use Swap sides if you pasted them the wrong way round. Everything runs locally in your browser, so nothing you compare is uploaded.

Reading the result

Red rows were removed, green rows were added, and a red row facing a green row is a changed line, with the exact edits shaded more strongly. The summary counts lines added, removed and changed. In inline view the output reads like a patch:

  1    # Launch checklist for the Larkspur site
- 3    3. Upload index.html, styles.css and the images folder.
+ 3    3. Upload index.html, styles.css, script.js and the images folder.
+ 5    5. Check every page for leftover lorem ipsum.
  6    6. Submit sitemap.xml in Google Search Console.

Line diff or word diff?

Code, CSV files, .htaccess rules and anything where line breaks mean something should be compared by line. Prose is different: in a contract or blog post a single line is often a whole paragraph, so a line diff just says "this paragraph changed". Word diff shows the three words that actually moved, which is what a reviewer or a client wants to see.

Tips for cleaner comparisons

  • Format code before you compare it. Two minified files are each one enormous line, so every difference looks like a full rewrite. Run both through the CSS, HTML and JS formatter or the JSON formatter first, with the same settings, and the diff becomes readable.
  • Use Ignore whitespace after re-indenting. Switching from tabs to spaces or changing indent depth touches every line; ignoring whitespace shows only real changes.
  • Watch for invisible differences. Curly quotes versus straight quotes, non-breaking spaces and trailing spaces all count as changes. If two lines look identical but are flagged, that is usually why.
  • Compare drafts, not just code. Before you sign off a client's copy changes, diff their version against yours. It catches the sentence nobody mentioned they rewrote.

Common mistakes

The most common one is pasting the versions on the wrong sides, which turns every addition into a deletion; swap them and read again. The second is trusting a diff of reformatted text. If someone re-wrapped a paragraph at a different width, every line changes even though no words did; switch to word diff and the real edits reappear. Finally, remember that a diff tells you what changed, not whether it is correct. Still test the page.

Frequently asked questions

How do I compare two texts for differences?

Paste the original version into the left box and the new version into the right box, or open a file into each one. Differences are highlighted straight away: removed text in red, added text in green, with a count of added, removed and changed lines above the result.

What is the difference between a line diff and a word diff?

A line diff treats each line as a unit and marks whole lines as added, removed or changed, which suits code and config files. A word diff highlights the exact words that changed, which suits prose, contracts and copy edits where one line may hold a whole paragraph.

Can the diff checker ignore whitespace and capitalization?

Yes. Turn on Ignore whitespace and differences in spaces, tabs and indentation are treated as equal, which helps when code has been re-indented. Ignore case does the same for capital letters. Both are off by default so nothing is hidden unless you choose.

Is my text uploaded when I compare it?

No. The comparison runs in your browser with JavaScript and nothing is sent to a server, so it is safe for private documents, contracts and unreleased code.

What algorithm does a diff checker use?

This tool uses the Myers diff algorithm, the same approach behind git diff and GNU diff. It finds the smallest set of insertions and deletions that turns one text into the other, which usually gives the most readable result.