Digital ToolPad.
Runs 100% in your browserYour data never leaves your device. zero uploads.

Text Diff

Original
Loading...
Modified
Loading...
Diff Result
+8-6
Original
Modified
1
function calculateTotal(items) {
1
function calculate(items, tax = 0) {
2
let total = 0;
2
let total = 0;
3
for (let i = 0; i < items.length; i++) {
3
for (let i = 0; i < items.length; i++) {
4
total += items[i].price;
4
total += items[i].price * items[i].quantity;
5
}
5
}
6
return total;
6
return total * (1 + tax);
7
}
7
}
8
8
9
const cart = [
9
const cart = [
10
{ name: "Apple", price: 1.50 },
11
{ name: "Banana", price: 0.75 }
10
{ name: "Apple", price: 1.50, quantity: 2 },
11
{ name: "Banana", price: 0.75, quantity: 3 },
12
{ name: "Orange", price: 2.00, quantity: 1 }
12
];
13
];
13
14
14
console.log("Total:", calculateTotal(cart));
15
const taxRate = 0.08;
16
console.log("Total with tax:", calculateTotal(cart, taxRate));

Working with Text Diff

A text diff is useful for reviewing configuration edits, code snippets, or generated output. Read the highlighted lines in context and use the whitespace setting deliberately. Export the result when you need to keep a record of a comparison.

How to use Text Diff

  1. Paste the original text and the changed text into their respective editors.
  2. Adjust whitespace or case comparison options as needed.
  3. Review highlighted additions and deletions, then copy or export the comparison.

Text Diff example

Compare two small configuration files where one setting changed and a new line was added. Check both the deleted and inserted lines rather than relying only on a change count.

What to expect from the result

The diff is text-based, not a parser for a particular programming language. Reordered lines may appear as removals and additions even when an application's behavior is unchanged.

Text Diff questions

How do I use Text Diff?

Paste the original text and the changed text into their respective editors. Adjust whitespace or case comparison options as needed. Review highlighted additions and deletions, then copy or export the comparison.

What should I check in the result?

The diff is text-based, not a parser for a particular programming language. Reordered lines may appear as removals and additions even when an application's behavior is unchanged.

100% private — your data never leaves your browser

No registration, no tracking of your content, no server uploads. Don't just take our word for it:

No server, no uploads

Your files and text are processed entirely on your device. Nothing is ever sent to us.

Works offline

Once loaded, this tool keeps working with your Wi-Fi turned off. Try it.

Verify it yourself

Open your browser's DevTools → Network tab. You'll see zero requests carrying your data.