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 metricRemoved Lines
-6
Live metricUnchanged Lines
1
Live metricTotal Diff Lines
10
Live metricHow 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
developer
JSON Formatter & Validator
Format, minify, and validate JSON data.
developer
Base64 Encoder / Decoder
Encode and decode Base64 strings and UTF-8 text.
developer
URL Encoder / Decoder
Encode and decode query strings and URL components.
developer
JWT Decoder
Decode JSON Web Token headers, payloads, and timestamps.