Code Compare

Compare two blocks of text or code line-by-line. Nothing leaves your browser.

0 lines
0 lines
Updates automatically as you type

How this works

This tool computes a line-based diff (similar to diff/git diff) using a longest-common-subsequence algorithm, entirely in JavaScript in your browser. It highlights lines added in the modified version in green and lines removed from the original in red; unchanged lines are shown for context.

Frequently asked questions

Does this understand code syntax, or just plain text?

It's a plain-text line diff — it doesn't parse language syntax, so it works the same for code, prose, or config files.

Why does a single changed character mark the whole line as different?

This tool diffs at the line level (like most diff tools), not character-level — any change anywhere in a line marks that whole line as removed+added.

Related tools