Skip to content
T
Tools.Town
Free Online Tools for Everyone
Diff Checker illustration

Diff Checker

100% Free

Compare two blocks of text or code side by side and highlight every added, removed, and unchanged line — with line, word, or character precision.

Line / Word / Char
Instant
100% Client-Side
No Sign Up
Diff level
Options
Diff updates live as you type.
+3
Added
-5
Removed
2
Unchanged
29%
Similarity
Original Text
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
}
New Text
1
function calculateTotal(items) {
2
  return items.reduce((sum, item) => {
3
    return sum + item.price * item.qty;
4
  }, 0);
 
 
 
 
 
5
}

Side-by-side view is line-aligned; line-level counts are reflected in the stats above. Everything runs in your browser.

Embed This Tool

Easy to Embed

Add Diff Checker to your website or blog in seconds.

  • Responsive design
  • Lightweight & fast
  • No backend required
  • Always up-to-date
<iframe
  src="https://tools.town/embed/diff-checker/"
  width="100%"
  height="600"
  style="border:none; border-radius:12px;"
  loading="lazy"
  title="Diff Checker">
</iframe>

Share This Tool

Share Instantly

Share Diff Checker with anyone — no login required.

  • Shareable link
  • No login required
  • Works on any device
  • No account needed

Share via

Advertisement

How to Use

  1. 1 Paste your original version into the Original Text panel
  2. 2 Paste the updated version into the New Text panel
  3. 3 Pick a diff level — line, word, or character
  4. 4 Toggle Ignore Whitespace or Ignore Case if needed
  5. 5 Press Compare to see the highlighted diff and stats
  6. 6 Copy the diff or upload a file to compare instead

Features

  • Three diff levels: line, word, and character precision
  • Side-by-side panels with line numbers and colour-coded changes
  • Added lines in green, removed lines in red, unchanged left plain
  • Ignore-whitespace and ignore-case options for noise-free diffs
  • Live stats: added, removed, unchanged, and a similarity score
  • Upload a file or copy the unified diff to your clipboard

Why it Matters

Spotting what changed between two versions is the core of code review, document editing, and debugging configuration. Eyeballing two blocks of text misses subtle edits and wastes time. A precise, colour-coded diff shows exactly what was added and removed, so you can review changes with confidence and never ship an unintended edit.

★★★★★

Use Cases

Code Review

See exactly which lines changed before merging a pull request

Config Comparison

Compare two environment or config files to find the drift

Document Editing

Track edits between two drafts at the word or line level

Debugging Output

Diff expected versus actual output to pinpoint a regression

What this tool does

The Diff Checker compares two versions of text or code and highlights exactly what changed. Paste an original and a new version, hit Compare, and you get side-by-side panels with line numbers, green for additions, and red for removals — plus a stats row showing added, removed, and unchanged counts and an overall similarity score.

How it works

The diff runs entirely in your browser. A Longest Common Subsequence (LCS) algorithm finds the largest set of unchanged tokens between the two inputs, then classifies everything else as added or removed. You choose the granularity — line, word, or character — and can ignore whitespace or case to filter out noise. The logic lives in a pure function.

Privacy

Everything runs locally. Your code and text are never uploaded, logged, or stored — safe for sensitive or proprietary work.

Frequently Asked Questions

What is the difference between line, word, and character mode?
Line mode compares whole lines and is best for code and config review. Word mode splits on whitespace and isolates the exact words that changed, which is ideal for prose. Character mode compares every character and is useful for tiny inline edits or single-line strings where one character matters.
Do Ignore Whitespace and Ignore Case change my text?
No. Those options only affect how lines are compared, not what is displayed or copied. Ignore Whitespace collapses runs of spaces and trims ends so reformatting does not register as a change; Ignore Case treats upper and lower case as equal. Your original text is preserved exactly.
How is the similarity score calculated?
It is the number of unchanged tokens divided by the larger of the two token counts, shown as a percentage. Two identical inputs score 100%, while completely different inputs score 0%. It gives you a quick sense of how much actually changed.
Is my code or text sent to a server?
No. The entire diff is computed in your browser using a Longest Common Subsequence algorithm. Nothing you paste or upload is ever transmitted, logged, or stored, which makes it safe for proprietary or sensitive code.
Can I compare files instead of pasting?
Yes. Each panel has an Upload File button that reads a local text or code file into the editor. The file stays on your machine — it is read directly in the browser and never uploaded.

Related Tools You Might Like

Browse more free tools