Text Diff – Compare Two Texts

Paste the original and the changed text to see exactly what was added and removed.

Loading tool…

About the Text Diff

Differences are computed with the jsdiff library, which implements Myers' O(ND) difference algorithm, the one behind diff and Git. Choose the granularity: Lines for code and config files, Words for prose and Characters to find a changed digit or a stray space. Removed text is struck through in red, added text is highlighted in green.

Side by side shows the original with removals next to the changed version with additions; Inline merges them into one stream, which is easier to read for small edits in long paragraphs. The counter shows how many lines, words or characters were added and removed. Ignore case and Ignore whitespace hide changes you don't care about, such as re-indentation.

Copy patch produces a unified diff (--- original.txt / +++ changed.txt with @@ hunks) that git apply or patch -p0 can use. Both texts stay in your browser, so it is fine to compare private config files.

How to use it

  1. Paste the original text on the left and the changed text on the right.
  2. Choose lines, words or characters.
  3. Switch between side-by-side and inline views.
  4. Copy or download the unified patch.

Frequently asked questions

Which diff mode should I use?
Lines for code, CSV and config; words for documents and prose; characters when changes are tiny, like a single digit or punctuation.
Can I get a patch file?
Yes. Copy patch or Download patch gives a unified diff that git apply and patch understand.
Why does a whole line show as changed?
In line mode any change marks the entire line. Switch to Words or Characters to see what changed within it.

Related tools