Skip to content
FastTool

Compare Two Texts

Compare two document drafts, config files, or code snippets word by word, spot hidden characters, and save a standard unified .patch.

Runs in your browser. Nothing is uploaded.

Original and modified text

Quick samples:

Original text (Left) 12 lines · 51 words · LF
Modified text (Right) 12 lines · 50 words · LF
Diff view mode

Word-by-word diff & hidden character check

  • 5 modified Line changes +0 added · −0 removed · 7 unchanged
  • −11 / +9 Word & token edits 20 changed word & symbol spans
  • 1 spotted Hidden characters Modified L12:C14 Non-breaking space (U+00A0)
  • LF ↔ LF Line endings Matching Unix LF (\n) line endings

Hidden character & line-ending check

Spotted 1 hidden character or line-ending alert that can break parsers or hide edits:

  • Modified line 12, col 14: Non-breaking space (U+00A0).
service-config-v1.yaml
service-config-v2.yaml
# Northstar Order API — Service Policy & Limits
# Northstar Order API — Service Policy & Limits
service: northstar-orders
service: northstar-orders
environment: production
environment: production
upstream:
upstream:
endpoint: https://api.northstar.example/v2/orders
endpoint: https://api.northstar.example/v2/orders
timeout_ms: 3000
timeout_ms: 4500
max_retries: 2
max_retries: 3
retention_notice: >
retention_notice: >
Customer billing logs stay in encrypted storage for 30 calendar days
Customer billing logs stay in encrypted storage for 45 business days
before automatic deletion, unless a written hold request is active.
before scheduled deletion, unless a written hold request is active.
headers:
headers:
cache_mode: "private, max-age=60"
cache_mode:NBSP"private, no-store"

Saves service-config-v1-vs-service-config-v2.patch with 1 unified hunk (@@ -3,10 +3,10 @@).

How to use

  1. Paste your original text on the left and your modified text on the right, or open two plain-text files.
  2. Drop two files onto either box at once to load the first file on the left and the second on the right.
  3. Pick Split side-by-side for config files, Inline word-by-word for prose paragraphs, or Unified .diff/.patch for Git hunks.
  4. Tick Ignore whitespace changes, Ignore uppercase/lowercase, or Trim blank lines when formatting noise hides real wording edits.
  5. Check the Hidden character panel for non-breaking spaces (U+00A0), zero-width spaces (U+200B), curly quotes, or CRLF mismatches.
  6. Select Download .patch for a standard unified diff file, or Download HTML report for a standalone color-coded page.

Worked example

Input

Two 12-line YAML service configs where v2 updates timeouts, rewords a retention paragraph, and pastes a header from chat.

Settings

Split side-by-side view with Highlight hidden characters ticked and 3 context lines selected for unified export.

Result

Pinpoints 5 modified lines, highlights exact changed words, flags 1 hidden U+00A0 on line 12, and builds @@ -3,10 +3,10 @@.

Line-only diff tools mark the entire two-sentence retention block red and green, forcing you to hunt for changed words manually.

Hunk counts: oldCount = 5 + 5 = 10, newCount = 5 + 5 = 10 → @@ -3,10 +3,10 @@

Word-span diffing isolates 30 calendar to 45 business and automatic to scheduled while leaving surrounding words unmarked.

On line 12, the amber NBSP badge exposes a U+00A0 character after cache_mode: that stops strict YAML parsers from reading the key.

How it works

Myers shortest-edit-script line and word alignment

The engine strips matching prefix and suffix lines first, then runs Myers O(ND) shortest-edit-script search across the remaining lines.

Inside each changed block, dynamic-programming similarity pairs edited paragraphs even when extra lines were inserted above or below them.

Each paired line is split into words, whitespace, punctuation, and special Unicode code points for a second Myers pass.

Catching invisible Unicode spaces and CRLF line endings

Copying snippets from chat apps, email clients, or word processors often substitutes non-breaking spaces (U+00A0) or curly quotes (Unicode UAX #14).

Zero-width spaces (U+200B) and UTF-8 byte order marks (U+FEFF) have zero pixel width yet break JSON, SQL, and environment keys (MDN Lexical Grammar).

Raw input bytes are scanned before line splitting so Windows CRLF (\r\n) versus Unix LF (\n) mismatches are reported right away.

Standard POSIX unified .patch export

Exported .patch files follow the POSIX.1-2017 diff -u specification with 1-based @@ -start,count +start,count @@ hunk headers ready for git apply or patch.

Sources checked 29 November 2026.

FAQ

When should I switch from Split side-by-side to Inline word-by-word?

Use Split side-by-side for YAML, JSON, SQL, and source code where column alignment matters. Switch to Inline word-by-word for long prose paragraphs and policy memos so deleted and added words read in one continuous sentence.

Why do two visually identical config files fail in production?

Hidden characters such as non-breaking spaces (U+00A0), zero-width spaces (U+200B), curly quotes, or Windows CRLF (\r\n) endings look like ordinary ASCII text in many editors. Keep Highlight hidden characters ticked to expose every code point and click Normalize Modified text to clean them.

What if I want to compare two CSV tables or JSON objects where key order changed?

Plain-text diff compares lines in file order. For row-and-column Excel or CSV tables use Compare Two Spreadsheets, and to format or check JSON syntax first open JSON Formatter & Validator.

Does Ignore whitespace changes hide U+00A0 alerts?

No. Ignore whitespace changes treats repeated ASCII spaces and tabs as equal when matching lines. The Hidden character panel still flags U+00A0, U+200B, and CRLF mismatches.

Can git apply or POSIX patch read the downloaded .patch file?

Yes. Downloaded .patch files include standard --- a/ and +++ b/ headers plus 1-based @@ hunk ranges compatible with git apply and patch -p1.

Are pasted drafts or opened files uploaded anywhere?

No. Every comparison, hidden-character scan, and .patch or HTML export runs inside your browser, so your text never leaves your device.

Step by step: how to compare two text drafts or config files and spot hidden character changes.

Updated