Text Diff Checker

Compare two texts side by side and see the differences

Text Diff Checker

Text Diff Checker

How it works

This tool compares two blocks of text using a Longest Common Subsequence (LCS) algorithm to compute a line-by-line diff. Added lines are shown in green, removed lines in red, and unchanged lines are displayed normally with both original and modified line numbers. The comparison runs automatically with a short debounce as you type, or you can click Compare to trigger it immediately. All processing happens entirely in your browser.

Frequently Asked Questions

How does the diff checker work?
It compares two texts line by line using a longest common subsequence (LCS) algorithm. Lines present only in the original are marked as deletions (red), lines present only in the modified version are additions (green), and unchanged lines are shown in their default color.
Can I compare code with this tool?
Yes. The tool works with any text including code. It compares line by line, which works well for structured text like source code, configuration files, and data. For large files, results appear instantly since the comparison runs locally.
Is this the same algorithm as git diff?
It uses a similar LCS-based approach but is simpler than git diff. Git uses the Myers diff algorithm with additional heuristics for performance on large files. For most practical comparisons, the results are equivalent.
Can I compare files instead of pasting text?
Currently the tool accepts pasted text in two text areas. To compare files, open them in a text editor, copy the contents, and paste into the left and right panels.

You might also like