← All tools
// Text

Text Whitespace Cleaner online

Remove, normalize, and collapse whitespace from any text

Text Whitespace Remover logo
by
CHUNKY
MUNSTER
// Input text
// Output

How to Use the Whitespace Converter

  1. Paste or enter your input into the text field.
  2. Configure any options (format, delimiter, encoding, or mode) using the controls above the output.
  3. The result updates instantly — no submit button required for most operations.
  4. Click Copy or Download to take the output to your next step.

Paste any text and pick the operations you want: convert tabs to spaces (or vice versa) at a given tab width, change line endings between Unix LF, Windows CRLF and old-Mac CR, strip trailing whitespace from every line, or collapse runs of spaces into a single space. All operations apply in one pass and are completely safe to combine.

How the Whitespace Converter Works

Useful when prepping a code snippet for a blog post (no trailing whitespace, consistent indentation), normalising a file pasted from Windows for use on a Linux server, or fixing the inevitable mixed-tab-and-space indentation in a Python file. The tab width can be set to anything reasonable (1 to 16); two and four are the most common in practice.

Frequently Asked Questions

What tab width should I use for Python?

PEP 8 recommends 4 spaces. Most Python projects (and Black, the formatter) enforce 4. Use 2 for JavaScript / Ruby projects that follow that convention.

What's the difference between LF, CRLF and CR line endings?

LF (\n) is Unix and modern macOS. CRLF (\r\n) is Windows. CR (\r) was classic Mac OS up to version 9 — rarely seen today but sometimes shows up in legacy files.

Will it break my text by collapsing spaces inside string literals?

Yes — collapse-runs-of-spaces is a blunt tool that affects everything, including string contents. Use it on prose, not code, unless you're sure no quoted whitespace matters.

Does it remove the UTF-8 byte-order-mark (BOM)?

If your input starts with a BOM (U+FEFF), the output won't include one. The tool always emits BOM-less UTF-8.

Explore the full suite of Text tools and 290+ other free utilities at Chunky Munster.