🔍 Diff Checker & Text Compare

Compare two texts side by side in your browser, nothing uploaded. Explains unified diff format and why CRLF line endings make every line look changed.

Free No Signup Required Browser-Based
+6 additions-4 deletions0 matching lines
1function calculateTotal(price, tax) {1function calculateTotal(price, tax, discount = 0) {
2 const total = price + tax;2 const subtotal = price - discount;
3 return total;3 const total = subtotal + tax;
4}4 console.log("Total computed:", total);
5 return total;
6}

What Diff Checker & Text Compare Does

A diff finds the smallest set of changes that turns one text into another. It is not a character-by-character comparison — it solves a longest-common-subsequence problem, which is why a diff can recognize that a block moved rather than reporting the whole file as rewritten.

The granularity you choose changes what you see. A line diff marks an entire line as changed if one character differs. A word diff highlights just the altered words, which is what you want for prose. A character diff catches a single transposed letter that a line diff would bury.

Comparison here runs entirely in your browser — nothing is uploaded. That is worth stating because the market leader in this category sells a desktop application specifically so that comparisons can be done offline, which tells you what the web versions do.

How to Use Diff Checker & Text Compare

  1. Paste your original text or code in the left box (Before)
  2. Paste your modified text or code in the right box (After)
  3. Choose between Side-by-Side Split view or Unified line view
  4. Optionally toggle Ignore Whitespace or Swap sides
  5. Inspect highlighted additions (green) and deletions (red)

Which Granularity to Use

ModeBest forWeakness
LineSource code, config files, logsA one-character edit marks the whole line changed
WordProse, documentation, contractsNoisy on code where whitespace is significant
CharacterSpotting a transposed letter or stray spaceUnreadable on anything large

Reading a Unified Diff

The format git, patch and most tools emit. Worth being able to read directly.

MarkerMeaning
--- a/fileThe original ("from") file
+++ b/fileThe new ("to") file
@@ -12,7 +12,9 @@Hunk header: from line 12, 7 lines became 9 lines
- removed linePresent in the original only
+ added linePresent in the new version only
context lineUnchanged, shown for orientation (leading space)
\ No newline at end of fileOne version lacks a trailing newline — a real difference

Why a Diff Shows Changes You Cannot See

When "everything changed" but nothing looks different, it is almost always one of these.

CauseSymptomFix
CRLF vs LF line endingsEvery single line marked changedNormalize endings, or enable "ignore line endings"
Trailing whitespaceLines look identical but differStrip trailing spaces, or ignore whitespace
Tabs converted to spacesWhole file rewritten by an editorCheck your editor's indent settings
Byte order mark (BOM)Only the first line differsSave without BOM
Non-breaking spaceA word looks the same but is notCharacter-level diff will reveal it
Unicode normalizationAccented characters differ invisiblyNormalize to NFC before comparing

How to Read Your Result

CRLF is the answer most of the time

Windows ends lines with carriage-return plus line-feed; Unix and macOS use line-feed alone. A file edited on both platforms, or checked out with the wrong git autocrlf setting, differs on every line while looking identical. If a diff claims a file was entirely rewritten and the author insists they changed one line, this is why.

A diff is not a merge

Finding differences is straightforward; deciding which side wins when both changed the same region is not. That is a three-way merge, and it needs the common ancestor as well as the two versions. A two-way diff can show you a conflict exists but cannot tell you how to resolve it.

Whitespace-insensitive diffs hide real bugs

Ignoring whitespace is the right default for reviewing prose or reformatted code. It is the wrong default for Python, YAML, Makefiles and anything else where indentation is syntax — there, a whitespace-only change can alter behavior completely.

Limitations & Accuracy Notes

  • Comparison happens in your browser and nothing is transmitted. Very large inputs are limited by browser memory rather than by any server limit.
  • This is a two-way text diff. It cannot perform a three-way merge, and it does not understand the structure of the content — a JSON diff tool will produce more useful output for JSON, because it compares values rather than lines.
  • Binary files, images and PDFs are not supported; the tool treats input as text.
  • Detecting a moved block depends on the algorithm and on how far it moved. Some moves are reported as a deletion plus an addition.
  • Invisible characters — zero-width spaces, non-breaking spaces, differing Unicode normalization — are genuine differences and will be reported, which is usually what you want even when it is surprising.

Frequently Asked Questions

What is a Diff Checker?
A Diff Checker compares two texts or code files line-by-line to identify differences, showing additions in green, deletions in red, and unchanged lines.
Is my text sent to any server?
No, all text comparison happens 100% client-side in your browser. Your confidential code and documents never leave your computer.
Can I ignore whitespace differences?
Yes, check the "Ignore Whitespace" option to disregard leading and trailing spaces or tab variations.
Are my files uploaded?
No. Both texts are compared in your browser. That is the main reason to use a local diff for anything confidential — source code, contracts, configuration — rather than pasting it into a service that processes it server-side.
Does it compare line by line or word by word?
Line by line, which is the standard approach and matches what version control shows. A line with a single character changed appears as one removal and one addition rather than a highlighted character.
Why does it show every line as changed?
Almost always line endings. A file saved on Windows uses carriage return plus line feed while one saved on macOS or Linux uses line feed alone, and the difference is invisible on screen but present in every line. Normalizing line endings in both before comparing fixes it.
Can it ignore whitespace?
Trailing whitespace and indentation changes will show as differences unless you strip them first. This matters most when comparing code that has been through a formatter, where a large diff can be entirely reindentation.
Can I compare two files rather than pasted text?
Paste the contents of each. Because nothing is uploaded, there is no file handling step — the comparison works on whatever text you put in the two panes.
Is there a size limit?
No imposed limit. Very large inputs are constrained by browser memory, and the comparison itself gets slower as the number of lines grows.

References & Further Reading

By OnlineToolHubs Team • September 2026