Compare two texts line by line — additions in green, removals in red.
What is a diff checker?
A diff checker compares two pieces of text and shows exactly what changed between them.
Lines that only exist in the original are marked as removals, lines that only exist in the
changed version are marked as additions, and everything else is shown as unchanged. This tool
computes the diff with the classic LCS (longest common subsequence) algorithm — the same
technique behind the Unix diff command and Git — so the result is the smallest
possible set of line changes.
How to use this tool
- Paste the original text into the Original text box and the new version into the Changed text box.
- Click Compare to see the unified diff below the buttons.
- Removed lines appear in red with a - prefix, added lines in green with a + prefix, and unchanged lines have no color.
- Tick Ignore trailing whitespace if you only care about content changes, not spaces at the end of lines.
Common uses for a diff checker
- Code review: paste two versions of a source file to spot exactly which lines were edited before committing.
- Config changes: compare an old and a new config file (nginx, YAML, .env) to catch the one setting that broke production.
- Contracts and documents: check what changed between two drafts of a contract, letter or essay without reading both in full.
- Data checks: verify that two exported lists or logs really are identical.
Common diff mistakes (and how to fix them)
- Texts pasted into the wrong boxes. Additions and removals are counted relative to the Original text box, so swapping the two versions flips every green line to red and vice versa. If the result looks backwards, swap the inputs rather than your conclusion.
- Expecting moved lines to be detected as moves. A line diff has no move concept: a paragraph cut from the top and pasted at the bottom appears as one red removal plus one green addition. Confirm it is a move, not a rewrite, by checking that the removed and added lines match exactly.
- Assuming the whitespace option ignores indentation. Ignore trailing whitespace only trims spaces at the end of each line. A line re-indented from two spaces to four still counts as changed, so normalize indentation before comparing if you do not care about it.
- Hitting the size limit. The comparison builds a table of lines(A) times lines(B) and stops when that product exceeds 4,000,000. Two 2,000-line texts pass exactly; 3,000 lines against 2,000 fails. Remove large unchanged sections and compare again.
Pro tip: ticking or unticking Ignore trailing whitespace re-runs the comparison automatically when text is present, so there is no need to click Compare again.
Frequently asked questions
What is a diff?
A diff (short for difference) is a comparison of two texts that shows what changed between them: which lines were added, which were removed, and which stayed the same. It is the standard way developers review changes to code, configuration files and documents.
Is this diff line-based or character-based?
This tool is line-based: it compares whole lines and marks a line as added or removed even if only one character in it changed. That mirrors how the Unix diff command and Git work, and keeps the output easy to scan.
Is my text uploaded to a server?
No. The comparison runs entirely in your browser with JavaScript. Nothing you paste is ever sent over the network, stored, or logged — you can even disconnect from the internet after loading the page and the tool keeps working.
What do the colors and symbols mean?
Red lines starting with a minus sign (-) exist only in the original text — they were removed. Green lines starting with a plus sign (+) exist only in the changed text — they were added. Lines without a color or symbol are unchanged. The status line above the output summarizes the totals, e.g. +3 additions, -2 removals.