Skip to main content

Diff Checker

Compare two pasted text drafts by line, word, or character

Samples:

Compare up to 50,000 UTF-16 code units across both inputs. Split view supports up to 5,000 combined lines. Text stays in this browser tab.

345 / 50,000 code units

Original Text(7 lines, 143 code units)
Changed Text(6 lines, 202 code units)
Compare By:
View:
Settings:

Differences Output

50% Match
Added (lines): +5Removed (lines): -6Unchanged (lines): 1
Original
1
-
function calculateTotal(items) {
2
-
let total = 0;
3
-
for (let i = 0; i < items.length; i++) {
4
-
total += items[i].price;
5
-
}
6
-
return total;
7
}
Changed
1
+
function calculateTotal(items: Array<{ price: number; tax?: number }>) {
2
+
return items.reduce((acc, item) => {
3
+
const itemTotal = item.price + (item.tax || 0);
4
+
return acc + itemTotal;
5
+
}, 0);
6
}

Was this Diff Checker helpful?

Help us keep tools reliable, fast, and bug-free.

What you can do with Diff Checker

  • Compare two texts

How this text processing works

Compare two pasted text drafts by line, word, or character and inspect labeled additions and removals.

Example input

Original: const status = 'pending';
Changed: const status = 'completed';

Example output

[REMOVED] const status = 'pending';
[ADDED] const status = 'completed';

Practical workflow

  1. Paste up to 50,000 UTF-16 code units combined into the Original Text and Changed Text editors, or load a built-in sample.
  2. Choose line, word, or character comparison granularity.
  3. For line comparisons, switch between split and unified views; word and character comparisons use unified highlighting.
  4. Optionally ignore case, normalize repeated spaces and tabs, or trim whitespace from each line edge.
  5. Review the highlighted result, expand the editors when needed, or download a diff report.

Common use cases

  • Auditing differences between configuration files across development, staging, and production.
  • Reviewing code refactoring changes before staging commits in Git.
  • Comparing legal contracts, terms of service drafts, or markdown documents for subtle wording edits.

Important notes and limitations

  • Comparison runs in the browser tab and does not upload or persist the two text inputs. The combined input limit is 50,000 UTF-16 code units.
  • Split line view supports up to 5,000 combined lines, and comparisons with more than 2,000 separate diff segments require smaller sections to keep rendering responsive.
  • Normalize Spaces and Tabs collapses consecutive spaces and tabs to one space while preserving line breaks; Trim Line Edges removes leading and trailing whitespace from each line.
  • The tool reports differences and downloads a report; it does not merge files or resolve conflicts.

Terminal & CLI equivalents

git diff without repository

git diff --no-index file1.txt file2.txt

Leverages git advanced Myers diff engine on two arbitrary files outside a git repository.

git inline word-level diff

git diff --word-diff file1.txt file2.txt

Highlights inline word modifications rather than marking entire lines as changed.

POSIX unified diff

diff -u file1.txt file2.txt

Generates standard unified diff format patch with 3 lines of surrounding context.

Diff Algorithm Performance & Character Matrix

Diff AlgorithmTime ComplexityHeuristic StrategyMemory UsageOptimal Use Case
Myers AlgorithmO((N+M)D)Finds shortest edit script with minimum insertions and deletionsO((N+M)D)Default for git diff, code reviews, and structured text
Patience DiffO(N log N)Matches unique identical lines first to isolate moved blocksModerateLarge refactorings with reordered functions or methods
Histogram DiffO(N log N)Frequency-based optimization of patience diffLowFast diffing on large source code files with repeated boilerplate

Common errors & troubleshooting

Every line is highlighted as modified despite identical text

Cause: Line ending discrepancy: one file uses Windows CRLF (\r\n) while the other uses Unix LF (\n).

Solution: Enable whitespace normalization or run 'dos2unix' / 'unix2dos' on the input files.

Continue your workflow

  • JSON Beautifier — format and pretty-print JSON files before comparing their differences.
  • SQL Formatter — structure database queries before running schema diff comparisons.
  • String Escaper — escape patch contents for inclusion in API requests or scripts.
  • Format Converter — normalize document serialization formats before comparison.
  • Regex Visualizer — Visualize regular expression state machines and capture groups as syntax diagrams.

Frequently asked questions

Does the diff checker support character-by-character change highlighting?

Yes. When lines contain partial edits, the checker highlights the exact characters and words that were added, removed, or replaced.

How do the whitespace controls affect the comparison?

Normalize Spaces and Tabs collapses repeated horizontal spaces and tabs but preserves line breaks. Trim Line Edges removes leading and trailing whitespace from every line.

Is my text uploaded or stored on any server during comparison?

The comparison runs in browser memory. The tool does not upload or save the two text inputs to its server.