Diff Checker

Compare original and modified text files or code snippets. Highlights additions, deletions, and unchanged lines with line numbers.

Original Text (Left)

Modified Text (Right)

Comparing 7 original vs 4 modified lines
Line-by-Line Comparison+3 / -6
1 -export function calculateTotal(items) {
2 - let sum = 0;
3 - for (let i = 0; i < items.length; i++) {
4 - sum += items[i].price;
5 - }
6 - return sum;
1+export function calculateTotal(items: Item[]): number {
2+ // Use modern Array.reduce
3+ return items.reduce((acc, curr) => acc + curr.price, 0);
74 }
Added Lines
+3
Live metric
Removed Lines
-6
Live metric
Unchanged Lines
1
Live metric
Total Diff Lines
10
Live metric

How to Use

01.Paste the original text into the Left box.
02.Paste the modified text into the Right box.
03.Click Compute Differences to view line-by-line additions and deletions.
04.Review summary statistics for added and removed lines.

Frequently asked questions

Yes. Differences are calculated locally in your browser memory using an in-memory LCS algorithm.

Related utilities