AI Utility

How to Clean Text for ChatGPT Before You Paste It In

Text copied from a webpage rarely comes in clean. Along with the words you actually want, you're usually pasting in leftover HTML tags, "smart" quotation marks, invisible formatting characters, and inconsistent spacing — none of which helps ChatGPT understand what you're asking, and all of which quietly cost extra tokens.

What's Actually Hiding in Copied Text

Why It Matters for LLM Input

None of this is usually a dealbreaker — ChatGPT can generally work around a stray tag or a curly quote. The real cost is token usage: markup and unusual characters often tokenize less efficiently than plain text, meaning the same visible content takes up more of your context window than it needs to. When you're pasting in a long article, documentation page, or research paper, that overhead adds up.

A Real Example

Take a short snippet of HTML copied from a blog post — two paragraphs with a heading, some curly quotes, an em dash, and a non-breaking space. Before cleaning, the tokenizer sees 116 tokens. After stripping the HTML tags, converting the smart punctuation to plain characters, and collapsing the extra whitespace, the same visible content drops to 77 tokens — a 33.6% reduction, without changing a single word of the actual meaning.

Clean your text before it ever reaches the chat window

Try the Clean Text Converter