Skip to main content

Text Diff

Compare two texts side by side and see exactly what changed. Line, word or character level, with options to ignore case and whitespace.

All Text tools →

This tool runs entirely in your browser. Nothing you enter is sent to our servers, so there is nothing for us to store or see.

About the Text Diff

Paste two versions of anything — a document, a config file, a block of code, an email draft — and see precisely what changed between them, aligned side by side with the additions and removals colour-coded and every line numbered on both sides.

Compare by line for documents and code, by word when you want to see which words inside a sentence changed rather than just "this whole paragraph is different", or by character for tracking down a single stray digit in an identifier. Options let you ignore case, ignore trailing whitespace, or ignore whitespace entirely — that last one is what you want when the only real change is that someone reindented the file.

It uses Myers' diff algorithm, the same one behind git diff. The reason that matters is practical: the textbook approach builds a table of every line in the first text against every line in the second, so comparing two 5,000-line files means twenty-five million cells and a browser tab that stops responding. Myers scales with the number of differences instead, so two near-identical documents compare in milliseconds no matter how long they are.

Everything runs on your own device. Comparing two versions of a contract or a config file usually means handling something you would rather not upload, and here you do not have to.

How to use the Text Diff

  1. Paste both versions

    The original on the left, the changed version on the right. The comparison updates as you type, and Swap flips the two if you pasted them the wrong way round.

  2. Choose the granularity

    Line is right for documents and code. Word shows which words inside a sentence changed. Character is for hunting a single wrong digit.

  3. Filter out noise

    Ignore case, ignore trailing spaces, or ignore all whitespace when a file has simply been reindented and you only care about real changes.

  4. Read the result

    Removals are shaded red on the left, additions green on the right, and modified lines are paired on the same row. The summary gives you the counts and the percentage unchanged.

Frequently asked questions

Is my text uploaded to a server?

No. The whole comparison runs in your browser and neither text is transmitted or stored. That matters here more than in most tools, because comparing two versions of a contract, a config file or a private document is exactly the situation where uploading it would be unwise.

What is the difference between comparing by line, word and character?

Line treats each line as one unit, so changing a single word marks the whole line as modified — right for code and documents. Word compares individual words, showing exactly which ones changed within a sentence. Character is the finest, useful for finding one wrong digit in an ID or a key.

Can it handle large files?

Yes. It uses Myers' algorithm, which scales with the number of differences rather than the size of the input, so two near-identical documents of any length compare almost instantly. Extremely large and completely dissimilar inputs fall back to a simpler comparison rather than hanging the page.

Why do my files show as completely different when they look the same?

Almost always line endings or invisible whitespace. A file saved on Windows uses carriage returns that a file saved on macOS does not, and trailing spaces are invisible but count. Turning on "Ignore all whitespace" will confirm whether that is the cause.

Is this the same as git diff?

It uses the same underlying algorithm, so the changes it identifies are the ones git would identify. The presentation differs — this shows both versions side by side rather than as a unified patch — and it works on any two blocks of text, whether or not they are in a repository.