Text Diff Checker

Compare two blocks of text or code with line and word-level diff.

Text
Original Text
Changed Text

What is a diff?

A diff (short for difference) is a comparison of two texts that identifies which lines (or words) were added, removed, or changed. The concept comes from the Unix diff command, first introduced in 1974, which compares files line by line and outputs a patch that can be applied to transform one file into another.

Diffs are fundamental to software development: Git uses diff algorithms to track changes between commits, code review tools display diffs so reviewers can see exactly what changed, and merge tools use three-way diffs to combine changes from two branches into one. The most common diff algorithm is the Myers diff algorithm (1986), which finds the shortest edit script (minimum number of insertions and deletions) to transform one sequence into another.

This tool shows additions highlighted in green and removals in red, making it easy to review changes to code, configuration files, documentation, or any text. The word-level diff mode narrows the highlight to the specific words that changed within a line, which is especially useful for prose editing.

Common mistakes

  • Line endings — Windows uses CRLF (\r\n), Unix uses LF (\n). Mixed line endings can cause every line to show as changed. Normalize line endings before comparing.
  • Trailing whitespace — A single trailing space on a line will show it as modified even if the visible content is identical.