Paste two code blocks to compare
Original
Modified
What This Tool Does
Compares two code blocks using an LCS diff algorithm. Removed lines appear in red on the left, added lines in green on the right, unchanged lines in neutral. Line numbers are shown for both panels. Results update live as you type. Click Sample to see a JavaScript function comparison example.
Frequently Asked Questions
What is the difference between Diff Checker and Text Diff?
The Diff Checker is optimised for code — it uses a monospace font, shows line numbers, and is designed for comparing code files, configuration, or structured text. The Text Diff Checker in the Text & String category is designed for prose and plain text comparison.
How does the diff algorithm work?
The tool uses a Longest Common Subsequence (LCS) algorithm to identify lines that are unchanged, added, or removed. Lines present only in the left panel are marked as removed (red); lines only in the right panel are marked as added (green).
Is my code sent to a server?
No. All comparison happens in your browser. Your code never leaves your device.