Diff Checker
Side-by-side line diff with add/remove highlighting and unified diff export.
Written by Golam Rabbani, Founder & Lead Engineer
How to use this diff checker
- Paste the original text into the left textarea.
- Paste the modified text into the right textarea.
- Toggle "Ignore whitespace differences" if you only care about content changes.
- Press Compare to run a line-by-line diff (LCS algorithm) entirely in your browser.
- Review the colour-coded result — green for additions, red for deletions — or use Copy unified diff to paste into a code review.
About this diff checker
The diff checker runs a classic longest-common-subsequence (LCS) line diff over your two inputs and highlights each line as added, removed, or unchanged. Both sides are split on newlines, compared with the same algorithm git and most code-review tools use, and rendered with line numbers for each side so you can scan changes quickly. Everything runs locally — your text never leaves the browser tab.
For example, comparing left "Hello world\nLine two\nLine three" against right "Hello world\nLine 2\nLine three\nLine four" produces: one unchanged line ("Hello world"), one removed line ("Line two"), one added line ("Line 2"), one unchanged line ("Line three"), and one added line ("Line four") — the summary reports 2 added · 1 removed · 2 unchanged. Use it for prose edits, configuration drift checks, log comparisons, and quick review of any text-pair where you need a precise change set without firing up a real diff tool. To keep the page snappy the diff is capped at 2,000 lines per side; larger payloads should use a desktop tool like vimdiff or VS Code's built-in diff editor.
FAQ
- What diff algorithm does this use?
- A standard longest-common-subsequence (LCS) algorithm over lines. It produces the same kind of "minimal edit script" that git diff and most code review tools use by default.
- Does the comparison consider whitespace?
- By default yes — every character counts. Toggle "Ignore whitespace differences" to trim each line and collapse runs of whitespace before the comparison, which is useful for spotting real content changes in noisy text.
- Is my text uploaded anywhere?
- No. The entire diff runs in your browser via JavaScript. Nothing is sent to a server, logged, or stored.
- Why is there a 2,000-line cap?
- LCS runs in O(n × m) time and memory, so very large inputs would freeze the page. Two thousand lines per side is well within an interactive budget. For larger payloads, use a desktop diff tool.
- Can I copy the result?
- Yes — the Copy unified diff button writes a familiar "+ added / - removed / spaces unchanged" listing to your clipboard, ready to paste into a pull request comment or chat message.