Diff Checker
Paste two texts to compare them and highlight what changed. Switch between line, word and character level diff. Everything runs in your browser — nothing is sent to any server.
Paste text in both panels to see the diff
Related Tools
Frequently Asked Questions
What algorithm does a diff tool use to find differences?▾
Most diff tools implement the Myers diff algorithm (1986), which finds the shortest edit script — the minimum set of insertions and deletions to transform one text into another. This is equivalent to finding the Longest Common Subsequence (LCS). It is the default algorithm used by GNU diff and git diff. The choice of algorithm matters because a poor implementation can produce technically correct but confusing results where logically related changes appear split across many unrelated hunks.
What is the difference between a line diff, a word diff, and a character diff?▾
A line diff compares documents line by line and marks entire lines as added or removed — the default mode and most useful for code. A word diff identifies which specific words within a changed line were altered (git diff --word-diff uses this). A character diff compares at the individual character level, most useful for catching typos, small config value changes, or comparing encoded strings. Many tools show a line diff with intra-line character highlighting as a hybrid approach.
What is unified diff format and how do I read it?▾
In unified diff format (produced by diff -u or git diff), lines prefixed with - are removed and lines prefixed with + are added. The @@ header shows the affected line ranges: @@ -10,7 +10,6 @@ means the original file at line 10 had 7 lines, the new file at line 10 has 6 lines. Unchanged context lines have no prefix. This format is standard for patch files and code review. Context diff (diff -c) is an older alternative that shows the two files in separate sections.
How are whitespace-only changes handled — can I ignore them?▾
By default, whitespace changes are treated as real differences. In git diff you can use --ignore-space-change (-b) to ignore changes in the amount of whitespace, or --ignore-all-space (-w) to ignore all whitespace entirely. This is essential when comparing code that was reformatted or had tabs converted to spaces. Note: ignoring whitespace can mask significant indentation changes in Python or YAML files where indentation is structurally meaningful.
Why do two files with identical visible content sometimes show differences?▾
Several invisible factors cause this: line endings (\r\n on Windows vs \n on Unix), a BOM (Byte Order Mark \xEF\xBB\xBF) at the start of a UTF-8 file, trailing spaces or tabs at the end of lines, and encoding differences (UTF-8 vs UTF-16 vs Latin-1). A diff showing differences between files that 'look the same' is almost always one of these. On macOS/Linux, cat -A reveals hidden characters; a hex viewer is the definitive diagnostic.