~/TechPurAILearn · Build · Grow
Start Learning
~/tools/text-diff-checker
Content Utilities

Text Diff Checker

Comparing two versions of the same text by eye — a draft before and after edits, two versions of a paragraph, a config file before and after a change — is slow and genuinely error-prone once the text runs more than a few lines, and a single changed word hiding inside an otherwise-identical paragraph is easy to miss entirely. This tool computes the difference directly: line by line first, then word by word inside any line that changed, so you see exactly what moved, not just that something in the neighborhood did.

Word-level highlighting inside a changed line

A plain line diff has a real limitation: if even one word in a line changes, the whole line gets marked as removed-and-replaced, with no indication of what specifically differs between the two versions. This tool goes a step further — once a removed line and an added line are recognized as a pair (the same relative position in each text, just different content), it runs a second diff between just those two lines at word granularity, and highlights only the words that actually changed. The rest of the line, including the surrounding words and the spacing between them, renders plainly. That's the same core idea behind tools like Diffchecker's inline highlighting — showing a change at the level a person would actually describe it ("this word changed"), not just the level the algorithm naturally produces ("this line is different").

Side-by-side or inline — pick what fits what you're comparing

Side-by-side puts the original in a left column and the changed version in a right column, line-aligned, which is the easier view when you want to read both full versions and see a change in its surrounding context on both sides at once. Inline collapses that into a single column, where a modified line shows as its removed version immediately followed by its added version — more compact, closer to how git diff or a pull request review presents changes, and often the better choice on a narrower screen or when you're mainly scanning for what changed rather than reading both versions in full.

Ignoring case and whitespace

Two lines that look identical to a reader can still register as "different" for reasons that have nothing to do with the actual content — different capitalization, a trailing space, tabs instead of spaces, extra blank padding from a copy-paste. The ignore case option treats uppercase and lowercase as equivalent when matching lines, so a heading that only changed from Title Case to lowercase doesn't show as a modification. The ignore whitespace option trims and collapses whitespace before comparing, so reformatted indentation or an invisible trailing space doesn't register as a change either. Both options only affect how lines are matched for the purpose of the diff — your original text is always what's displayed, exactly as you typed it.

How the underlying algorithm works

At the core of both the line-level and word-level comparisons is the same algorithm: longest common subsequence (LCS), the same fundamental approach git diff and the classic Unix diff command use. It finds the longest possible run of elements — lines, in the first pass; words, in the second — that appears, in the same relative order, in both sequences, computed with a dynamic-programming table rather than a simplified approximation. Everything inside that shared run is unchanged; everything outside it is marked removed (only in the original) or added (only in the new version). Running it twice, once per granularity, is what makes it possible to say both "this line changed" and "specifically, this word within it changed" instead of only the former.

The known limitation worth understanding: moved content

Because the algorithm looks for a common sequence in matching relative order, it has a specific, well-understood blind spot: if a block of unchanged text moves to a different position in the document — a paragraph relocated from the end to the beginning, a reordered list item — without any of its own content changing, the diff generally can't recognize that as "the same content, relocated." It typically shows the moved block as removed from its original position and separately added at its new one, even though nothing within the block itself actually changed. This isn't specific to this tool — it's an inherent limitation of LCS-based diffing in general, and detecting genuine block moves as a distinct operation requires meaningfully more sophisticated algorithms than most diff tools, including many production ones, actually implement. If a comparison shows a large block as both fully removed and fully added with identical content, moved-not-changed is the most likely explanation.

A diff only compares two snapshots

This tool tells you what differs between the two pieces of text you pasted in — it has no memory of earlier versions, no edit history, and no sense of why something changed. For tracking incremental edits to a single document over time, a version control system or a word processor's built-in change tracking (turned on from the start) is the right tool; this one is for the much more common case of having two independent snapshots and wanting to know what's different between them, right now.

Frequently asked questions

How does this decide what counts as 'the same' line versus a changed one?

It uses a line-based longest common subsequence (LCS) algorithm — the same underlying approach tools like git and the classic Unix diff command use for line diffing — to find the longest run of lines that appears, in the same relative order, in both versions. Everything outside that shared sequence is either removed (only in the original) or added (only in the changed version). When a removed line and an added line fall in the same position, the tool treats that pair as one modified line and runs a second, word-level diff between just those two lines specifically, rather than only marking the whole line as different.

How does the word-level highlighting work inside a modified line?

Once a removed line and an added line are paired up as a single modification, the tool runs the same LCS algorithm again at word granularity on just that pair — splitting on whitespace so spacing itself is preserved as its own token — and highlights only the words that actually differ. A one-word edit in an otherwise-unchanged sentence shows that one word highlighted, not the entire line flagged as replaced.

What's the difference between the side-by-side and inline views?

Side-by-side shows the original and changed text in two aligned columns, which is usually easier to scan when you want to see both full versions at once. Inline shows a single column where a modified line appears as a removed line directly followed by its added replacement, closer to how git diff or a code review tool presents a change — more compact, and often preferable when you're comparing something narrow, like a single paragraph or a config file, on a smaller screen.

What do 'ignore case' and 'ignore whitespace' actually change?

Ignore case treats uppercase and lowercase letters as equivalent when deciding whether two lines match, so a line that only changed in capitalization registers as unchanged instead of modified. Ignore whitespace collapses runs of spaces/tabs and trims leading and trailing whitespace before comparing, so reformatted indentation or an accidental trailing space doesn't register as a change. Both only affect how lines are matched — the original text you typed is still what's displayed, unaltered, in the result.

Is there a size limit on how much text this can compare?

Yes, capped at 4,000 lines per side. The underlying algorithm's cost grows with the product of both texts' line counts, so an extremely large input would noticeably slow down the browser tab computing the comparison. For comparing paragraphs, articles, config files, or most reasonably sized documents, this limit exists to keep the tab responsive rather than to meaningfully constrain everyday use.

Does this save, share, or store the text I paste in anywhere?

No. There's no account, no generated share link, and no saved history — comparing two pieces of text happens entirely in your browser's own JavaScript and never leaves the page. That's a deliberate difference from tools built around a save-and-share workflow: this one is for a quick, private comparison, not for publishing a diff for someone else to view later.