Text Diff — Compare Two Texts
Paste two pieces of text and see exactly what changed. Choose line, word, or character granularity, and switch between inline and side-by-side views.
Granularity options
- Line — best for code, configuration files, and structured text. Two lines are either identical or different.
- Word — best for prose. Shows changed words with surrounding context preserved.
- Character — finest-grained, useful when whitespace matters or when comparing short strings.
How the diff is computed
This tool uses the jsdiff library, which implements the standard Myers diff algorithm. The same algorithm powers Git, most code editors, and the diff command-line utility — so the results match what you'd see in git diff for line-based comparison.
Frequently asked questions
Is my text uploaded anywhere?
No. The comparison runs entirely in your browser using a vendored copy of jsdiff.
Why does "ignore whitespace" still show some differences?
The option collapses runs of whitespace within a line to a single space and trims leading/trailing whitespace, but it does not remove differences in non-whitespace content. So changing foo bar to foo bar is ignored, but foo vs. foo bar is still flagged.
Can I diff two files?
Open both files in any text editor, copy the contents into the two boxes above, and you'll see the diff. The tool handles inputs up to a few megabytes comfortably.