Code Diff Checker
Compare two code snippets side by side with line-by-line diff highlighting. Spot added, removed and changed lines fast. Your code stays in your browser.
Original
Stays in your browserChanged
Stays in your browserShortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)
Free Online Code Diff Checker
Paste two versions of a code snippet to see exactly what changed, rendered as two aligned columns — the way most IDEs and Git diff tools display a code review. For prose and documents use Text Compare; for JSON use JSON Compare. It helps engineers review source changes, generated files, and configuration patches without installing a repository diff tool.
Why a side-by-side diff view
A side-by-side layout puts the original and changed line directly next to each other on the same row, which makes it much faster to spot exactly what was edited within a line — a renamed variable, a changed condition, a tweaked string — compared to scanning a single unified list of additions and removals stacked on top of each other. This mirrors how most code editors and Git hosting platforms present a diff, so the output should feel immediately familiar if you've reviewed a pull request before.
How to use this tool
Paste the original version of your code into the left box and the modified version into the right box, then click Compare. Removed lines are highlighted on the left in red, added lines are highlighted on the right in green, and unchanged lines appear plainly on both sides so you have context around each change.
Common use cases
- Reviewing a small code change before committing it, without opening a full Git client
- Comparing a function before and after a refactor to confirm only the intended lines changed
- Checking what changed between two versions of a config file or script pasted from different sources
- Spotting subtle differences between two nearly-identical code snippets from Stack Overflow or an AI assistant
The comparison runs entirely in your browser using a local line-diff algorithm — neither snippet is ever uploaded to a server.
Worked example
Original function add(a, b) {
return a + b;
} against changed function add(a, b) {
return a + b;
} (only the indentation of the middle line changed, 2 spaces to 4) shows the opening and closing braces as unchanged context and the middle line as a red/green pair. Set Whitespace to "Ignore start and end" and the middle line counts as unchanged too.
Common mistakes and edge cases
- With Whitespace set to compare exactly, a pure reindent or trailing space shows as a full change; use the option to ignore it before reading a red/green pair as a logic change.
- Inside a changed pair, the words (or characters) that differ get a stronger colour, so a renamed variable in a long line is easy to spot.