Skip to content
FastTool

How to compare two text drafts or config files and spot hidden character changes

Line-only diff tools mark whole paragraphs changed while missing invisible spaces and Windows CRLF endings that break config parsers.

Updated · Uses the free Compare Two Texts tool, which runs in your browser

Short answer

Paste or drop both versions into Compare Two Texts. Pick Split side-by-side for YAML, JSON, or SQL configs, or Inline word-by-word for multi-sentence prose paragraphs. Keep Highlight hidden characters ticked so non-breaking spaces (U+00A0), zero-width spaces (U+200B), curly quotes, and CRLF mismatches show amber badges. Click Normalize Modified text to clean hidden characters, or click Download .patch to export a standard POSIX unified diff.

Open the Compare Two Texts tool

Choosing Split side-by-side, Inline word-by-word, or Unified .patch

Each view mode solves a different reading job while running the same Myers word-span comparison underneath:

When to use each diff view mode for prose, configuration files, and Git patches
View mode Best file types What it shows
Split side-by-side YAML, JSON, SQL, .env, and source code. Aligns paired lines in two columns and highlights only changed numbers, keys, or hidden badges.
Inline word-by-word Policy memos, Markdown articles, and long paragraphs. Places struck-through deletions beside bold additions inside one sentence so your eyes never jump across columns.
Unified .diff/.patch Git patches, bug tickets, and terminal change logs. Formats file headers and @@ hunk ranges ready for git apply or patch -p1.

Five hidden character traps that make identical-looking files fail

Pasting snippets from chat apps, email threads, or cloud editors often injects non-ASCII characters that look blank on screen:

  • Non-breaking space (U+00A0): typed by Option+Space on macOS or copied from rich text. Strict YAML and SQL parsers reject it as an unexpected byte.
  • Zero-width space (U+200B) and BOM (U+FEFF): occupy zero pixels yet change environment variable names such as DB_HOST into unrecognized keys.
  • Windows CRLF vs Unix LF: appends \r before every line break, causing Linux shell scripts to fail with carriage-return errors.
  • Curly quotes (U+201C and U+201D): smart-quote replacements look subtle in monospace fonts yet break JSON, Python, and .env strings immediately.
  • Trailing spaces and tabs: sit invisibly at the end of lines, altering YAML block scalars and Markdown line breaks.

Worked example: reading unified diff @@ headers and spotting U+00A0

Open Compare Two Texts to inspect the built-in 12-line Northstar YAML service configuration:

  1. Word-level precision. On line 9, only 30 calendar to 45 business lights up instead of coloring the entire 22-word retention sentence.
  2. Spotting the hidden space. On line 12, an amber NBSP badge flags U+00A0 right after cache_mode: before the quoted header string.
  3. Reading the hunk header. Switching to Unified .diff/.patch shows @@ -3,10 +3,10 @@ right below the two file header lines.
  4. Checking the line math. Starting at line 3, 5 unchanged context lines plus 5 removed lines equal 10, matching 5 context plus 5 added lines.

You can open the hidden U+00A0 and CRLF config trap or open the inline policy memo comparison directly in your browser.

When to use table or JSON formatting tools before comparing

Plain-text diff compares lines from top to bottom, so reordered records look like full-block deletions and insertions:

Common mistakes

  • Ticking Ignore whitespace changes on Python or YAML indentation. Indentation changes block nesting in both languages; untick whitespace ignoring before final sign-off.
  • Exporting a 0-context patch for moving files. Keep 3 context lines (standard) selected so git apply can anchor hunks safely when line numbers shift.
  • Comparing pasted JSON without checking syntax first. A single curly quote breaks JSON parsing; clean hidden characters with Normalize Modified text before saving.

Sources

Spotted a mistake in this guide? Email contact@fasttool.app. We reply within 7 business days.

Open the Compare Two Texts tool