Tools Guides
text Free No signup

Text Diff Highlighter

Compare two texts with word-level, character-level, or line-level diff highlighting.

Loading tool…

About this tool

Paste two pieces of text and instantly see what changed. Switch between word-level, character-level, and line-level diff modes. Added content is highlighted in green, removed content in red with strikethrough, and a similarity score is shown.

How to use

  1. 1 Step 1: Paste or type your original text in the left panel.
  2. 2 Step 2: Paste or type the new/modified text in the right panel.
  3. 3 Step 3: Choose a diff mode: Word, Character, or Line.
  4. 4 Step 4: View the highlighted diff inline or toggle to side-by-side view, and check the stats summary.

What a text diff actually computes

Comparing two pieces of text is not as simple as walking them side by side and flagging the first character that differs — that would mark everything after a single inserted word as "changed." A proper diff finds the longest common subsequence (LCS): the largest set of pieces that appear, in the same order, in both versions. Whatever is left over on the original side was deleted, and whatever is left over on the new side was added. This tool implements that LCS algorithm directly, so it identifies the smallest real set of insertions and deletions rather than a naive position-by-position mismatch.

Three granularities: line, word, and character

The same text can be compared at three levels, and choosing the right one is the difference between a useful diff and a noisy one:

ModeComparesBest for
Linewhole lines split on newlinesCode, config files, logs — anything line-structured
Wordwords and the whitespace between themProse, edited paragraphs, copy revisions
Characterevery single characterSpotting a one-letter typo or a changed digit

Word mode is the most common choice for everyday text because it keeps unchanged words intact and highlights only the words that moved, while line mode mirrors what developers see in version control. Character mode is the most precise but also the busiest — use it when you suspect a tiny change you cannot find by eye.

A worked example

Put The quick brown fox on the left and The slow brown fox jumps on the right, in word mode. The LCS is "The brown fox" — those words survive in order. The tool marks quick as removed (struck through, red), slow as added (green), and jumps as added at the end. It then reports the statistics: +2 words added, −1 word removed, and a similarity score. Similarity is computed as twice the number of matching tokens divided by the total tokens in both texts, expressed as a percentage — so two identical texts read 100%, and texts with nothing in common approach 0%.

Inline versus side-by-side views

The inline view weaves both versions into one stream: deletions struck through in red, insertions highlighted in green, sitting next to the unchanged text. It is compact and good for short edits. The side-by-side view puts the original on the left with only its deletions marked and the new version on the right with only its additions marked, which makes it far easier to read a heavily rewritten passage. You can switch views freely; the underlying diff is the same, only the presentation changes.

Practical use cases

  • Reviewing edits. Paste a draft and its revision to see exactly what an editor or collaborator changed, word for word.
  • Catching silent config changes. Diff two versions of a settings file in line mode to find the one value that was altered.
  • Comparing terms or contracts. Word mode surfaces every clause that was added, removed, or reworded.
  • Verifying a copy-paste. Character mode confirms whether two strings that look identical truly are, down to a trailing space.

Common mistakes and limits

  • Using character mode on long text. It produces an overwhelming amount of highlighting and is slow; reach for word or line mode unless you are hunting a single character.
  • Forgetting whitespace counts. In word mode the spaces between words are tokens too, so a change in spacing can show up as a difference — usually what you want, occasionally surprising.
  • Pasting huge inputs. The LCS algorithm builds a comparison grid, so cost grows with the product of the two token counts. This tool caps the combined size (around 20,000 tokens total) and warns you to trim the input rather than freezing the page.
  • Expecting it to detect moved blocks. A paragraph relocated from top to bottom reads as one deletion plus one insertion, not a "move" — that is inherent to how diffs work.

Privacy

Both texts are compared entirely in your browser using the built-in algorithm — nothing is uploaded or stored on a server. That makes it safe to diff confidential drafts, internal config, or unreleased copy, and it works even with your network disconnected.

Frequently Asked Questions

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}