View:
Level:
Original 19 lines
Modified 22 lines
Diff Result
Added Removed Unchanged
Original
Modified
1 function calculateTotal(items) {
1 function calculateTotal(items, discount = 0) {
2 let total = 0;
2 let total = 0;
3 for (let i = 0; i < items.length; i++) {
4 total += items[i].price;
3 for (const item of items) {
4 total += item.price * item.quantity;
5 }
5 }
6 return total;
6 return total * (1 - discount);
7 }
7 }
8
8
9 const TAX_RATE = 0.05;
9 const TAX_RATE = 0.08;
10 const FREE_SHIPPING_THRESHOLD = 500;
10
11
11 function getOrderSummary(order) {
12 function getOrderSummary(order) {
12 const subtotal = calculateTotal(order.items);
13 const subtotal = calculateTotal(order.items, order.discount);
13 const tax = subtotal * TAX_RATE;
14 const tax = subtotal * TAX_RATE;
15 const shipping = subtotal >= FREE_SHIPPING_THRESHOLD ? 0 : 50;
14 return {
16 return {
15 subtotal,
17 subtotal,
16 tax,
18 tax,
17 total: subtotal + tax
19 shipping,
20 total: subtotal + tax + shipping
18 };
21 };
19 }
22 }

What is Diff Checker?

A diff checker (short for "difference checker") compares two pieces of text — documents, code files, configuration files, or any text — and visually highlights every addition, deletion, and modification between them. The term comes from the Unix diff command, a core tool in software development since the 1970s that remains essential to this day.

Diff tools are indispensable in software development for reviewing code changes before committing to a version control system. They are equally valuable outside of programming: comparing two drafts of a contract, checking what changed between two versions of a document, identifying differences in configuration files, verifying that a translation matches the original structure, and auditing log files for unexpected changes.

Altairys's Diff Checker shows a side-by-side or unified diff view with colour-coded highlights: green for added lines, red for removed lines, and yellow for modified lines. It handles large texts efficiently, shows a change summary (lines added/removed), and provides character-level diff for modified lines so you can see exactly which word or character changed, not just which line. The tool works entirely in your browser — your text is never sent to any server.

How to Use Diff Checker

  1. Paste original text

    Enter your original (old) text in the left panel.

  2. Paste modified text

    Enter the new or updated version in the right panel.

  3. Compare

    Click Compare to instantly see all differences highlighted in colour.

  4. Switch view mode

    Toggle between side-by-side and unified views depending on your preference.

Key Benefits

Colour-coded

Green for additions, red for deletions, yellow for modifications — instantly readable.

Side-by-side & unified

Two view modes: side-by-side for easy scanning, unified for a compact single-column view.

Character-level diff

For modified lines, see exactly which characters changed — not just the whole line.

Fully private

Your text is compared locally in your browser — nothing is uploaded to any server.

Frequently Asked Questions

A diff is the difference between two versions of a text. The term comes from the Unix "diff" command, which outputs a description of how to transform one file into another by adding, removing, or replacing lines.

Yes. The diff checker works with any plain text, including code in any programming language, JSON, XML, YAML, SQL, HTML, CSS, and more. Paste the code content directly.

Unified diff shows both the original and modified text in a single column, with "+" markers for additions and "-" markers for deletions. Side-by-side view shows both versions in two parallel columns.

Yes, the diff algorithm is optimised for performance and handles large texts efficiently in the browser. Very large files (100,000+ lines) may slow down slightly depending on your device.

Related Tools