Diff Checker
Paste two texts and compare them line by line. See which lines were added, removed or unchanged, side by side or in one column.
Each text can have up to 5000 lines. Lines are compared exactly, including line endings and a missing final newline.
| Line | Original | Line | Changed |
|---|
How to use
- Paste the earlier version into Original text and the newer version into Changed text. The comparison updates on every keystroke, so there is no compare button.
- Read the status line. It says whether the texts are identical, whether changes are shown, or why the input was refused.
- Check the three counters: lines added, lines removed and lines unchanged.
- Choose Side by side to see the original on the left and the changed text on the right, with line numbers. Choose Inline for a single column with
-and+marks.
Worked example
Original text. Both texts here end with a line break after the last line, so press Enter once after the last word:
apple banana cherry
Changed text:
apple blueberry cherry date
The tool reports 2 lines added, 1 line removed and 2 unchanged. The inline view reads:
apple - banana + blueberry cherry + date
apple and cherry are the longest run of lines that both texts share, so they stay. banana exists only in the original and blueberry and date only in the changed text. The tool does not say that banana "became" blueberry. It reports a removal and an addition, and the side-by-side view puts them on the same row so you can see the pairing.
How it works
Each text is split into lines. A Windows (CRLF) break counts as part of its line, and two lines match only when both their text and their line ending are identical. The comparison then looks for the longest common subsequence: the most lines that appear in both texts in the same order. Everything outside that sequence is a removal or an addition. In each changed block the removed lines are listed before the added ones.
Finding a longest common subsequence is the classic basis of diff tools. The best-known efficient method is described in Eugene Myers' paper An O(ND) Difference Algorithm and Its Variations (1986). The GNU diffutils manual explains how the command-line diff shows the same added and removed lines. Where several equally long common sequences exist, different tools can choose different ones, so the exact pairing may differ from another tool's. The counts of added and removed lines are always consistent with a longest common sequence.
Common mistakes and edge cases
- Invisible differences. A trailing space, a tab in place of spaces, or a changed line ending makes two lines different even though they look the same. If a diff shows a change you cannot see, suspect whitespace. Lines with no newline at the end are marked as such.
- Reflowed paragraphs. The comparison is by line, not by word. If a paragraph was re-wrapped, every line in it counts as changed. Put each sentence on its own line before comparing prose.
- Moved blocks. A paragraph that was cut and pasted elsewhere shows as removed in one place and added in another.
- Line limit. Each text can have up to 5000 lines. Longer input is refused so the page stays responsive. Compare the file in sections instead.
- Different line endings. A file saved on Windows and the same file saved on Linux differ on every line. Convert the endings first if you only care about the words.
Frequently asked questions
Does it compare characters or words inside a line?
No. It reports whole lines only. A one-letter change shows the whole line as removed and the new line as added.
Why does the identical message not appear when the text looks the same?
The comparison is exact. A missing final newline, trailing spaces or a different kind of line break will count as a difference.
Can I use it for code review?
It suits quick checks of snippets, configuration files and exports. For a repository, use git diff, which also tracks file names and history.
Is my text uploaded?
No. Both texts stay in the page and are not sent or stored.
Why are removed lines shown before added lines?
It is the usual diff convention. Within one changed block the old lines come first, then the new ones.
Related tools
- JSON Formatter & Validator to format two JSON documents the same way before comparing them.
- CSV and JSON Converter to turn exports into a shape that is easier to compare.
- Word & Character Counter to see how much longer one draft is than another.
- Hex Dump to inspect the raw bytes of a file when a difference is not visible as text.