Text Comparator

Paste two texts and see every difference highlighted instantly.

Ad
0 added
βˆ’ 0 removed
0 unchanged
Paste text into both fields above to see the diff.
Ad

What is a text comparator?

A text comparator (or diff tool) takes two versions of a text and highlights the differences between them line by line. Lines that were added in the modified version are shown in green with a + prefix. Lines that were deleted from the original are shown in red with a βˆ’ prefix. Unchanged lines are shown in grey and can be hidden to focus on just the changes.

This tool is useful for comparing document revisions, code snippets, configuration files, emails, legal text, translations, or any two versions of a piece of writing. The diff algorithm used is the classic longest common subsequence (LCS) approach β€” the same principle behind tools like git diff.


How to use

  1. Paste your original text into the left box.
  2. Paste your modified text into the right box.
  3. The diff updates instantly β€” green lines were added, red lines were removed.
  4. Toggle Hide unchanged lines to focus only on differences.
  5. Use Ignore case or Ignore whitespace for a looser comparison.

Frequently Asked Questions

This tool uses a longest common subsequence (LCS) algorithm β€” the same fundamental approach used by git diff, Unix diff, and most code review tools. LCS finds the largest set of lines that appear in both texts in the same order, then marks everything else as added or removed. It works on lines, not characters, so it's best for comparing text that has meaningful line structure.

Yes β€” paste code directly into either box. The monospace font and line-by-line comparison work well for code. For very large files (thousands of lines), the diff may take a moment to compute as LCS has O(nΓ—m) complexity. The tool handles files up to around 2,000 lines comfortably.

No. All diff computation runs entirely in your browser. Your text is never sent to any server, never logged, and never stored. Closing the tab removes everything immediately.

Related Tools

Ad