Code diff

Code diff

Compare two blocks of code line by line in side-by-side or unified view.

About this tool

Comparing two versions of a file by eye is slow. A line diff marks the lines that stayed the same and the lines that were added or removed, so the real change is easy to find.

Paste an old and a new version to see a side-by-side or unified diff. Ignore trailing whitespace when that is noise, then copy a unified patch. Both texts stay in your browser.

Worked example

Changing c to C in a five-line file gives one removed line, one added line and three unchanged lines. A unified patch with three lines of context starts @@ -1,5 +1,5 @@.

Common searches