Text Diff Checker

Paste two texts to find every difference. Side-by-side or inline view. Line, word and character-level diff. Ignore whitespace and case. Similarity percentage shown.

text-diff.tool
Original
Modified

Three Ways to Compare

Line diff compares the two texts line by line — the standard mode for code, configs, and any structured text. Each changed line is shown with a + or − prefix. Word diff goes deeper: within each changed line, it highlights the specific words that changed rather than marking the whole line. Best for prose, documents, and paragraphs. Character diff is the most granular — it highlights every individual character that differs, useful for spotting subtle typos, punctuation changes, or encoding differences.

Side-by-side vs Inline

Side-by-side shows Original on the left and Modified on the right, each with their own line numbers. Deletions are highlighted in the left panel, additions in the right — you never see both on the same line. This is the easiest view for reviewing large changes. Inline shows everything in a single stream, with deletions struck through in red and additions highlighted in green, which is more compact for small diffs.

Ignore Whitespace and Case

Whitespace changes — extra spaces, trailing spaces, tab vs space indentation — are often irrelevant when you want to see only the meaningful content changes. Tick "Ignore whitespace" to normalise all spacing before comparing. "Ignore case" makes the comparison case-insensitive, useful for comparing text where capitalisation differences are unimportant. These options apply to what is shown in the diff, not to the original text in the inputs.

Hide Unchanged Lines

On long documents with only a few changes, "Hide unchanged lines" removes all lines that are identical in both versions. Only the changed lines are shown, making it easy to jump straight to what matters. This is the equivalent of a collapsed diff view.

Frequently Asked Questions

Line diff compares whole lines — if any character in a line changed, the entire line is marked as changed. Word diff finds the specific words within lines that changed, giving a more precise view of what was edited. Character diff is the finest level — it identifies individual characters, useful for catching typos, punctuation changes, or invisible whitespace differences. For code and structured text, line diff is usually most useful. For prose and documents, word diff gives a clearer picture of edits.
Many text editors and copy-paste operations introduce trailing spaces, convert tabs to spaces, or change line endings. These changes are invisible to the eye but appear as differences in a strict comparison. "Ignore whitespace" normalises all runs of whitespace to a single space before comparing, so only actual content changes appear. This is especially useful when comparing code that has been reformatted or text that has been through different word processors.
The similarity percentage is calculated based on how many tokens (lines, words, or characters depending on your selected mode) are identical in both texts. 100% means the texts are identical. 0% means they share no common tokens at all. The percentage uses a standard LCS (Longest Common Subsequence) algorithm, the same approach used by Unix diff and Git.
No. All comparison runs in your browser using JavaScript. Your text never leaves your device. This makes WTEC's diff checker safe for comparing confidential code, private documents, API keys, and any sensitive data. You can verify this by checking your browser's network tab — no requests are made when you click Compare.
The Clean button (↓) on each input panel trims leading and trailing whitespace from the whole text, removes trailing spaces from each line, and normalises Windows line endings (CRLF) to Unix (LF). This pre-processing step removes common noise before you diff, so the results focus on meaningful content changes rather than formatting differences.