Compare two blocks of text and instantly see what was added, removed, or unchanged — line by line or word by word — with a live diff summary, all computed in your browser.
A text diff (short for 'difference') identifies exactly what changed between two versions of a piece of text — what was added, what was removed, and what stayed the same — and presents that comparison in a way that's easy to scan visually, typically using color coding: green for additions, red for removals. Rather than requiring you to manually re-read both versions side by side and spot every discrepancy yourself, a diff tool does that comparison automatically and highlights only the parts that actually differ.
Diffing is foundational to modern software development — every code review, every Git commit, and every pull request is built around a diff showing exactly which lines changed — but the same underlying technique is just as useful outside of code: comparing two drafts of a document, two versions of a legal contract, two revisions of an email before sending, or two config files to spot an accidental change.
Line-based diffing, the mode used by Git and virtually every code review tool, treats each line as an indivisible unit — a line either matches a line in the other text exactly, or it's flagged as changed. This works extremely well for code and structured, line-oriented text, where line boundaries carry real meaning (a line of code, a row in a config file, an entry in a list) and where seeing exact line numbers matters for locating a change in a larger file.
Word-based diffing instead breaks text into individual words and compares those sequences directly, which is far better suited to flowing prose. Prose is frequently re-wrapped or re-flowed — the same sentence might span different lines depending on where it's pasted — so a line diff on prose often reports far more 'changes' than actually occurred, simply because line breaks moved. Word diff sidesteps this entirely by ignoring where line breaks fall and instead showing you precisely which words were added, removed, or replaced, which is exactly what you want when reviewing an edited paragraph, a rewritten email, or revised marketing copy.
Most text diffing tools, including the one powering this page, are built on a variation of Eugene Myers' 1986 diff algorithm, which finds the shortest possible sequence of insertions and deletions needed to transform one text into another. Conceptually, the algorithm searches for the longest common subsequence shared between the two texts — the largest set of lines or words that appear in the same relative order in both — and then everything that isn't part of that shared subsequence gets classified as either removed (only in the original) or added (only in the modified version).
This 'shortest edit path' approach is why diffs tend to look clean and minimal rather than reporting every line as different when only a small part of a document actually changed — the algorithm specifically favors preserving as much matched, unchanged content as possible rather than the more naive alternative of treating the entire text as one giant replacement. It's also why the exact same underlying technique scales from comparing two short sentences up to comparing entire multi-thousand-line source files with reasonable performance.
Beyond code review, text diffing shows up constantly in everyday work: checking exactly what an editor changed in a document draft before accepting their edits, verifying that a 'find and replace' operation across a large document did exactly what was intended and nothing more, comparing two versions of a legal or business contract to spot every modified clause, auditing a configuration file change before deploying it to production, or simply confirming that two blocks of text you expect to be identical actually are, character for character.
It's also a useful sanity check any time text passes through an automated process — a translation tool, a formatter, a template engine — where you want confidence that only the intended parts changed and nothing else was silently altered along the way. A quick diff before and after such a transformation turns an assumption ('this should be the same except for X') into a verified fact.
Text Diff Checker compares two versions of text directly. These related text tools handle other common text-processing tasks you'll often reach for in the same workflow.