Diff Checker

Text & Code

Compare two text or code snippets with highlighted differences.

+5 additions-7 deletions1 unchanged lines
Myers algorithm
Original (Old)
Modified (New)
Diff Output
-
function calculateTotal(items, discountRate) {
-
  let subtotal = 0;
-
  for (let i = 0; i < items.length; i++) {
-
    subtotal += items[i].price;
-
  }
-
  const tax = subtotal * 0.08;
-
  return (subtotal - (subtotal * discountRate)) + tax;
+
function calculateTotal(items: CartItem[], discountRate: number = 0): number {
+
  const subtotal = items.reduce((acc, item) => acc + item.price, 0);
+
  const discount = subtotal * Math.min(Math.max(discountRate, 0), 1);
+
  const tax = (subtotal - discount) * 0.0825;
+
  return Number((subtotal - discount + tax).toFixed(2));
}

Technical Specification & Client Security

Compare two text or code snippets with highlighted differences. All formatting, transformations, and diffing algorithms run directly in your browser using local Web Workers and client RAM. No source code, authentication tokens, or database queries are sent across the network.

›Side-by-side split and unified inline diff viewing modes
›High-performance Myers diff algorithm running locally in your browser
›Additions, deletions, and unchanged line counts calculated instantly
›Optional whitespace-ignoring mode for indentation-insensitive comparisons
›Persistent workspace state stored locally in your browser
›One-click swap and copy utilities for both original and modified texts

Frequently Asked Questions

Is my proprietary code uploaded when using this diff tool?

No. All diff calculations run locally in your browser using client-side JavaScript. Your code is never transmitted to any external server or saved in any database.

Can I compare large files or minified code?

Yes. The diff algorithm parses thousands of lines efficiently without UI blocking. You can toggle unified and split views to inspect line additions and deletions comfortably.

Does this support syntax highlighting across multiple programming languages?

The tool compares arbitrary text, Markdown, JSON, and source code in all programming languages with green addition (+) and red deletion (-) markers.

Related Developer Utilities