Diff Checker
Compare two code files or snippets and highlight differences.
Compare Code
Diff
About the Diff Checker
The Diff Checker compares two snippets of code or text and marks what changed. Paste the original on the left and the modified version on the right, and the output shows lines that were added, removed or left alone.
The comparison is line by line, using a longest-common-subsequence algorithm, so it finds the smallest set of insertions and deletions that turns one version into the other rather than flagging everything after the first difference. That is the same approach version control uses.
Because it works on lines, a single character changed inside a long line shows the whole line as modified. For prose and configuration files that is usually fine; for careful code review, a word-level diff tells you more.
Common questions about Diff Checker
Does it compare lines or characters?
Lines. One changed character marks the whole line as different.
What do the colours mean?
Lines only in the original were removed, lines only in the modified version were added, and unmarked lines are identical.
Does it ignore whitespace?
No. Trailing spaces and indentation differences count as changes.
Is my code uploaded anywhere?
No. The comparison runs in the browser, so nothing leaves your machine.
Is there a size limit?
The algorithm compares every line against every other, so very large files get slow. A few thousand lines is comfortable.
Can I compare JSON or HTML?
Yes. Any text works, though reformatting one side first will make the diff easier to read.