Whitespace describes behavior, not one character

The word “space” is often used as if every gap in text were identical. Unicode and text formats provide several characters for different jobs: separating words, aligning columns, preventing a wrap, marking a new line, or adding typographic width. Some format controls occupy no visible width at all but are commonly discovered during whitespace cleanup because they can make two apparently identical strings compare differently.

This matters when text moves between HTML, word processors, PDFs, spreadsheets, source code, and plain-text fields. The destination may preserve the character while changing how it is displayed. A browser can wrap at a regular space but keep the same words together at a non-breaking space. A tab may align columns in one editor and appear much wider in another.

Common spacing and control characters

Code pointNameTypical behaviorCleanup question
U+0020SpaceVisible word separator that normally permits wrapping.Should repeated gaps become one?
U+0009Horizontal TabAdvances to an editor-defined tab stop.Is it indentation, alignment, or a TSV delimiter?
U+00A0No-Break SpaceVisible separation while discouraging a line wrap.Should wrapping become normal while the gap remains?
U+2007Figure SpaceDigit-width spacing often used for numeric alignment.Will replacing it alter a designed table?
U+202FNarrow No-Break SpaceNarrow typographic separation with no-break behavior.Does the language or typography require it?
U+2002–U+200ATypographic spacesSeveral widths such as en, em, thin, and hair space.Is visual width meaningful or accidental?
U+000ALine Feed (LF)Starts a stored line on Unix-like systems.Is the line break structural or copied wrapping?
U+000D U+000ACRLFTwo-code-unit Windows line ending.Does the destination require a specific ending?
U+200BZero Width SpaceAllows a wrap without drawing a gap.Was it intentional or pasted residue?
U+200C/U+200DZWNJ / ZWJControls joining in scripts and emoji sequences.Could removal change meaning or rendering?

Zero-width controls need a separate decision

ZWNJ and ZWJ are Unicode format controls rather than ordinary whitespace. Grouping them with invisible-character cleanup is convenient for diagnosis, but deleting them indiscriminately can be wrong. ZWJ participates in many combined emoji, while both controls can influence shaping in writing systems whose letters join. A cautious cleanup should therefore distinguish U+200B and a stray BOM from ZWNJ and ZWJ.

How to diagnose an unknown gap

  1. Copy the smallest affected sample and keep the original.
  2. Check whether the problem is visible width, unexpected wrapping, indentation, a stored line ending, or an exact-match failure.
  3. Use a character-specific audit. Counts for NBSP, tabs, or zero-width controls are more informative than blindly replacing every whitespace character.
  4. Apply the narrowest transformation and compare the output in the destination application.
  5. For source code, Markdown, numeric tables, emoji, and multilingual text, verify semantics as well as appearance.

Use a broad space remover when

  • Prose contains inconsistent runs of several horizontal spacing types.
  • Line endings should remain but spacing inside each line can be normalized.
  • One regular U+0020 separator is acceptable between words.
  • The input is not code or a fixed-width layout.

Use a focused tool when

  • Only tabs should change while ordinary spaces remain.
  • Only no-break behavior is causing a wrapping problem.
  • Invisible controls cause exact-match or import failures.
  • Blank lines or line edges are the real source of the problem.

HTML entities and stored Unicode characters

In HTML source,   is an entity notation that the browser parses into U+00A0. Once text is copied from the rendered page, the clipboard usually contains the Unicode character, not the five letters and punctuation of the entity. Replacing the literal string   therefore does not repair every pasted NBSP. The stored character must be detected.

Choose the appropriate tool

Use Remove Non-Breaking Spaces for U+00A0, U+2007, and U+202F. Use Remove Zero-Width Characters when invisible format controls are suspected. The tab tool can preserve tab-stop alignment, while Remove Empty Lines handles whitespace-only rows without joining content lines. The complete tool directory compares every available transformation.