About this tool
Collapse stray spaces, tabs, blank lines and invisible Unicode characters in pasted prompts, with a before/after character count.
Prompt Whitespace Normalizer rewrites a pasted prompt so that every run of repeated spaces, tab, stacked blank line and invisible Unicode character is reduced to clean, predictable text. It handles the characters that copy-paste drags in without showing them: U+00A0 no-break space, U+200B zero-width space, U+FEFF byte-order mark, Windows CRLF line endings and the U+2000-U+200A quad and hair spaces. Useful for anyone maintaining prompt libraries, system messages or few-shot examples where stray characters change tokenisation and inflate cost.
Open Prompt Whitespace Normalizer on AltFTool — it loads instantly in your browser.
Paste or type the text you're working with.
Choose how it should be transformed or analyzed.
Copy the finished text into your document or post.
Reports how many zero-width and exotic-space code points the paste contained, not just the visible mess.
Each rule — tabs, indentation, blank lines, trailing space — is an independent toggle you can leave off.
Text is normalised in the browser, so confidential prompts are never uploaded anywhere.
Yes. Most byte-pair tokenizers encode runs of spaces and newlines as their own tokens, so a prompt with stacked blank lines and double spaces costs slightly more than the same prompt cleaned up. As a rough guide, one token is about four characters of English text, so removing 400 stray characters saves roughly 100 tokens per call.
A zero-width space is U+200B, an invisible code point used for line-break hints in web pages and word processors. Copying from a website, a PDF or a rich-text editor can carry it — along with U+200C, U+200D and the U+FEFF byte-order mark — into your prompt, where it takes up tokens and can split a word mid-token.
The default settings only touch whitespace and invisible formatting characters, so wording, punctuation and line order stay exactly as written. If your prompt contains indentation-sensitive content such as Python code or YAML, turn off 'Remove leading indentation' and set tabs to 'Keep' before cleaning.
Set 'Maximum consecutive blank lines' to 1. Any run of two or more blank lines collapses to a single blank line, which preserves paragraph separation while removing the padding that accumulates when sections are edited and moved around.