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.
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:
| 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 asDB_HOSTinto unrecognized keys. - Windows CRLF vs Unix LF: appends
\rbefore every line break, causing Linux shell scripts to fail with carriage-return errors. - Curly quotes (
U+201CandU+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:
- Word-level precision. On line 9, only
30 calendarto45 businesslights up instead of coloring the entire 22-word retention sentence. - Spotting the hidden space. On line 12, an amber NBSP badge flags
U+00A0right aftercache_mode:before the quoted header string. - Reading the hunk header. Switching to Unified .diff/.patch shows
@@ -3,10 +3,10 @@right below the two file header lines. - 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:
- CSV and Excel tables: open both sheets in Compare Two Spreadsheets to match rows by key column and spot changed cells.
- Minified or unindented JSON: pretty-print both payloads in JSON Formatter & Validator first, then paste the formatted blocks into Compare Two Texts.
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 applycan 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
- POSIX.1-2017 diff utility specification (checked 29 November 2026), defining
diff -uheaders and 1-based@@ -l,s +l,s @@hunk ranges. - Unicode Standard Annex #14 (checked 29 November 2026), specifying non-breaking space (
U+00A0) and zero-width space (U+200B) line-break behavior. - MDN JavaScript Lexical Grammar (checked 29 November 2026), covering
U+FEFFbyte order marks, whitespace points, andLFvsCRLFterminators.
Spotted a mistake in this guide? Email contact@fasttool.app. We reply within 7 business days.