Text Diff Checker
Paste two versions of any text to see exactly what changed. Added lines are highlighted in green, removed lines in red, with a quick count of additions and deletions — all in your browser.
Your text is compared entirely in your browser — nothing is uploaded to any server.
Understanding the Text Diff Checker
The Text Diff Checker compares two blocks of text and shows exactly what changed between them. Paste an original and a changed version, click Compare, and it highlights removed lines in red and added lines in green, with a running count of additions and deletions. It is built for developers reviewing edits, writers tracking revisions, and anyone comparing two versions of a config, email, or document. An optional toggle ignores leading and trailing whitespace. Everything runs locally in your browser using JavaScript — your text is never uploaded to a server, so it is safe for private or sensitive content.
How it works
The tool splits each text into an array of lines and computes a longest common subsequence (LCS) — the largest set of lines that appears in the same order in both versions. It fills a 2D dynamic-programming table of LCS lengths, then backtracks through that table from the start: matching lines become 'unchanged', lines only in the original become 'removed', and lines only in the changed text become 'added'. The result is a single unified list of rows rendered in order. With the whitespace option on, each line is trimmed before comparison (but the original text is still displayed), so indentation-only changes are not flagged.
Worked example
Suppose the Original line 2 reads 'jumps over the lazy dog.' and the Changed version reads 'leaps over the lazy dog.', with a new line 'Hello, world!' inserted before the final 'Goodbye.' After clicking Compare, the tool marks 'jumps over the lazy dog.' as removed (red, '-' prefix), 'leaps over the lazy dog.' as added (green, '+'), 'Hello, world!' as added, and leaves the identical first and last lines gray. The summary reads: 2 additions, 1 deletion.
Tips & common mistakes
- The diff is line-based, so a single changed word shows the whole line as one removal plus one addition rather than highlighting just the word.
- Turn on 'Ignore leading/trailing whitespace' when comparing indented code or text where only spacing changed, to cut down on noise.
- Paste both versions with the same line endings — mixed CRLF and LF can make otherwise-identical lines appear different.
- Use 'Copy diff' or 'Download .txt' to save the unified result, where '+' marks additions, '-' marks deletions, and two spaces mark unchanged lines.
- If both boxes contain the same text, the tool simply reports that the two texts are identical instead of listing rows.
- For very large inputs, compare smaller sections at a time — the tool guards against extremely large comparisons to stay responsive.
Related tools
Frequently Asked Questions
Does it compare line by line or character by character?
The diff is line-based. It uses a longest common subsequence (LCS) algorithm over the lines of each text, so whole lines are marked as added, removed, or unchanged.
Can I ignore whitespace differences?
Yes. Tick "Ignore leading/trailing whitespace" and each line is trimmed before comparing, so changes in indentation or trailing spaces are not counted as differences.
Is my text sent anywhere?
No. The comparison runs entirely in your browser using JavaScript. Your text is never uploaded to a server.