Text Diff & Compare

Find the differences between two pieces of text. Choose line, word, or character granularity. Side-by-side or unified view. Runs entirely in your browser.

Original
Changed
Type or paste text in both panels to see differences

Need to scan documents to real PDFs?

Offline PDF Scanner turns your phone camera into a real PDF scanner — with searchable text, not just photos. Works completely offline.

What this text diff tool does

It compares two blocks of text and highlights exactly what was added, removed, or unchanged between them. Under the hood it uses the longest common subsequence algorithm — the same technique Git, Diff, and most version-control systems use.

Three granularity modes

  • Lines — compares line by line. Best for source code, configuration files, and structured text where line boundaries carry meaning.
  • Words — breaks text into words (runs of non-space characters) and shows which words changed. Best for prose and documents where you edited inside paragraphs.
  • Characters — the finest grain, highlighting every changed character. Best for short strings, API responses, and anywhere you need to see the tiniest differences.

Side-by-side vs unified view

Side-by-side shows both versions next to each other with added lines in green on the right and deleted lines in red on the left. Unified (inline) merges changes into a single flow — deletions in red with strikethrough, additions in green. Unified is more compact; side-by-side is easier to read for substantial changes.

Normalization options

  • Ignore caseHello and hello are treated as equal.
  • Ignore whitespace — helpful when comparing reformatted code or text with different indentation.
  • Ignore line endings — on by default. Treats \\r\\n (Windows) and \\n (Unix) as equivalent, so files copied across operating systems don't show as entirely different.

Privacy

Both inputs stay in your browser. The diff engine runs locally via the jsdiff library. Nothing is uploaded — handy when comparing sensitive documents, contracts, or internal code.

Frequently Asked Questions