Skip to content
WriteWithin

Whitespace Cleaner Suite

Clean extra spaces, tabs, and hidden Unicode characters — with a multilingual-safe mode other removers skip.

Presets

Clean spaces

Hidden & Unicode

Lines & indentation

Processing order is fixed: BOM/zero-width → Unicode/NBSP → line endings → PDF join → trims → collapse → blank lines → tab conversion.

Why this cleaner is different

  • See invisible characters before you delete them
  • Safe zero-width cleanup for Arabic / Indic scripts
  • Unicode + NBSP normalization — not just double spaces
  • PDF line-break repair + blank-line controls
  • Private in-browser processing in 16 languages

How to remove extra spaces

Turn on Remove extra spaces to collapse runs of spaces or tabs into one. Line breaks stay unless you choose Remove blank lines. Useful for email drafts and scraped paragraphs.

Trim leading and trailing spaces

Trim trailing spaces clears end-of-line junk common in code and CMS exports. Trim leading spaces removes indentation — leave it off if you need code indent.

Normalize spaces and non-breaking spaces

Word and Google Docs often insert non-breaking spaces (U+00A0) and odd Unicode gaps. Normalize spaces and Replace non-breaking spaces convert them to ordinary spaces so search, diffs, and CMS fields behave.

Convert tabs to spaces

Tabs to spaces expands every tab using your tab width (2, 4, or 8). Spaces to tabs only converts leading indentation — never spaces inside sentences — so prose stays readable.

Remove zero-width spaces safely

Safe mode removes zero-width space (U+200B) and BOM. Aggressive mode also removes joiners that Arabic, Persian, Urdu, and some Indic text may need. Prefer safe mode unless you are cleaning known junk.

How to reveal invisible characters

Enable Show invisible characters to preview spaces (·), tabs (→), NBSP (⍽), and zero-width marks in the output pane. Copy always uses the cleaned text without markers.

Fix PDF line breaks

Copied PDF text often breaks mid-sentence. Fix PDF line breaks joins those hard wraps, then your space options tidy the result.

Related tools

Text Character Cleaner · Line Tools · Line Counter · Case Converter · URL Cleaner

Why whitespace cleanup matters

Text that looks fine on screen often fails the moment you paste it somewhere else. Email threads hide double spaces after periods. Word and Google Docs insert non-breaking spaces that search tools cannot find. PDF copy-paste breaks every sentence onto its own line. Code editors choke on trailing tabs. CMS fields reject invisible zero-width characters you never typed.

The WriteWithin Whitespace Cleaner fixes spacing and invisible Unicode junk in your browser — nothing is uploaded. That privacy-first design matters when you are cleaning client emails, internal tickets, or bilingual family messages on a shared laptop. Most jobs take seconds once you know which options to turn on.

What this tool cleans

Extra spaces and tabs

Remove extra spaces collapses runs of ordinary spaces and tabs into a single space within each line. Line breaks stay put unless you also choose blank-line options. Trim trailing spaces clears end-of-line junk common in code diffs and scraped HTML. Trim leading spaces removes indentation — leave it off when you are cleaning source code you still need to compile.

Convert tabs to spaces expands every tab using your chosen width (2, 4, or 8). Convert spaces to tabs only rewrites leading indentation, never spaces inside sentences, so prose stays readable while code blocks regain consistent indent markers.

Non-breaking spaces and Unicode gaps

Replace non-breaking spaces turns U+00A0 — the character Word uses to keep two words on the same line — into an ordinary space. Normalize spaces does the same for thin spaces, figure spaces, ideographic spaces, and other Unicode whitespace variants that look identical to the naked eye but break find-and-replace, CSV imports, and strict validators.

If your text still misbehaves after normalization, pair this step with the Text Character Cleaner, which handles punctuation, emoji, and control characters whitespace tools deliberately leave alone.

Zero-width characters: safe vs aggressive

Safe zero-width mode removes zero-width space (U+200B) and byte-order marks — the invisible junk most paste disasters share. Aggressive mode also strips zero-width joiners and non-joiners that Arabic, Persian, Urdu, and some Indic scripts use to shape letters correctly. Use aggressive mode only when you are certain the text is Latin-only or you are cleaning known spam markers.

Multilingual writers on WriteWithin should default to safe mode. It catches the problems that break URLs and database fields without touching script joiners your readers depend on.

PDF line breaks and blank lines

Fix PDF line breaks joins hard-wrapped lines that end mid-sentence — the classic symptom of copying from an academic paper or legal PDF. The tool looks for a lowercase letter starting the next line and merges with a space, then your collapse and trim options tidy the result.

Collapse blank lines reduces runs of empty rows to a single gap — ideal for email forwards. Remove blank lines drops empty rows entirely. For list deduplication or sorting, switch to Line Tools, which treats whitespace-only rows as blank when you need stricter list hygiene.

Show invisible characters

Enable Show invisible characters to preview spaces (·), tabs (→), non-breaking spaces (⍽), and zero-width marks in the output pane. Copy always uses the cleaned text without markers — the preview is for diagnosis, not export. When a colleague insists "there is nothing wrong with this paragraph," turn the preview on and the hidden characters become obvious.

Processing order (fixed pipeline)

Options run in a deterministic sequence so results are predictable every time:

  1. Strip BOM from the start of the file
  2. Remove zero-width characters (safe or aggressive)
  3. Replace NBSP and normalize Unicode spaces to ordinary spaces
  4. Normalize line endings internally for processing
  5. Optionally join PDF hard line breaks
  6. Trim leading and trailing spaces per line
  7. Collapse repeated spaces and tabs, or remove all spaces
  8. Apply blank-line collapse or removal
  9. Convert tabs ↔ spaces and restore your chosen line-ending style

Because order is fixed, you can reason about outcomes: PDF join runs before space collapse, so merged sentences get a single space between words rather than a double gap.

Presets for common paste sources

Five one-click presets configure the options above for typical sources:

  • Email paste — collapse spaces, replace NBSP, collapse blank lines
  • Word / Docs — same as email, tuned for office-document spacing
  • PDF text — adds hard line-break repair on top of space normalization
  • Code indent — tabs to spaces, trailing trim, LF line endings, no space collapse inside lines
  • CMS / scraper — trim both ends of every line, collapse spaces, LF endings

Start with a preset, then toggle individual options if the preview still looks off.

Whitespace Cleaner vs related tools

The Character Cleaner removes letters, numbers, emoji, punctuation, and symbols — or keeps only the classes you specify. It also offers Unicode NFC/NFKD normalization and script-aware accent stripping. Use it when the problem is what characters exist, not how many spaces sit between words.

Line Tools operates on whole lines: dedupe, sort, filter by keyword, join into paragraphs, or split on width. Use it when structure — not intra-line spacing — needs fixing. A common chain: Whitespace Cleaner first, then Line Tools to dedupe a contact list.

Line Counter measures lines, words, and characters without changing text. Case Converter and URL Cleaner handle casing and link hygiene respectively — orthogonal to spacing.

Step-by-step: clean a messy paste

  1. Open the Whitespace Cleaner and paste your text into the input box.
  2. Choose a preset matching your source (Email, Word, PDF, Code, or CMS).
  3. Turn on Show invisible characters if anything still looks suspicious.
  4. Review the output stats — characters removed and line count — and scan the preview.
  5. Copy the cleaned output and paste into your destination app.

Common mistakes to avoid

  • Aggressive zero-width on Arabic or Hindi text — stick to safe mode unless you know the script does not need joiners.
  • Trim leading spaces on indented code — use the Code preset or disable leading trim.
  • Expecting deduplication here — duplicate lines need Line Tools, not space collapse.
  • Removing smart quotes here — curly quotes and em dashes are character-level; use the Character Cleaner.
  • Running collapse twice across tools — one pass through the pipeline is enough; chaining the same option in another tool rarely helps.

Benefits of in-browser whitespace cleaning

  • No account, no upload — text stays on your device
  • Deterministic pipeline — same input and options always produce the same output
  • Multilingual-safe zero-width handling other removers skip
  • Live stats show how many characters and lines changed
  • Works on Chromebooks, borrowed laptops, and locked-down corporate browsers

Writers preparing submissions for platforms with strict plain-text rules, developers normalizing config files before commit, and support staff cleaning ticket paste all benefit from repeatable output without installing a desktop editor. Undo and reset options let you experiment with aggressive settings on a copy without losing your original paste.

Common questions

Will this break Arabic or Hindi text? Safe zero-width mode removes only zero-width spaces and BOM. Aggressive mode can strip joiners some scripts need — use it only when you are sure.

Can I see invisible characters before deleting them? Yes. Show invisible characters previews markers in the output pane; copy still uses clean text without markers.

Is my text uploaded? No. Cleaning runs entirely in your browser.

What if I need to count lines afterward? Open the Line Counter with your cleaned text to verify submission limits.

Should I normalize before or after case conversion? Whitespace cleanup first, then Case Converter — hidden spaces can make casing look uneven.

Frequently asked questions

Will this break Arabic or Hindi text?

Safe zero-width mode removes only zero-width spaces and BOM. Aggressive mode can remove joiners that some scripts need — use it only when you know you need it.

Can I see invisible characters?

Yes. Turn on Show invisible characters. Copy still uses cleaned text without markers.

Is my text uploaded?

No. Cleaning runs in your browser. Text never leaves your device.

What order do options run in?

A fixed pipeline: BOM and zero-width cleanup, Unicode/NBSP normalize, line-ending normalize, optional PDF join, trims, space collapse, blank-line rules, then tab conversion.