Code Diff

Compare two code snippets side by side with syntax highlighting.

+4 added-4 removed
Original
1-function greet(name) {
2- console.log("Hello, " + name);
3- return name;
4 }
5
6 const result = greet("world");
7-console.log(result);
Modified
1+function greet(name: string): string {
2+ console.log(`Hello, ${name}!`);
3+ return name.trim();
4 }
5
6 const result = greet("world");
7+console.log("Result:", result);
Your files never leave your device
How it works

Three steps to done

1Drop your file

Drag and drop or click to browse

2Processed locally

Runs in your browser, nothing uploaded

3Download result

Get your file instantly

Use cases

When to use this

Code review

Paste two versions of a function side by side to review what changed before approving a pull request.

Compare config files

Diff two configuration files to identify differences between environments or versions.

Spot regressions

Compare a working version to a broken version of a script to quickly isolate what changed.

Code diff tool with line numbers

Paste two code snippets and instantly see what changed. Green lines are additions, red lines are deletions, and unchanged lines are shown in context. Both side-by-side and unified views are available. Line numbers are shown on both sides so you can reference changes precisely.

The tool uses an LCS diff algorithm, the same technique used by Git. It compares line by line and produces a minimal diff that shows only the relevant changes without noise.

Everything runs in your browser. No code is uploaded or sent to a server. The language selector is provided for labeling purposes only and does not affect how the diff is computed.

Frequently Asked Questions

More tools

Related tools

All tools

3 free uses left today

Unlimited with Pro

Go Pro — $4.99/mo