How to Remove Hidden Characters from AI Text
You paste a paragraph from ChatGPT into your email client, hit send, and it looks fine. Then a colleague replies with a screenshot: the spacing is wrong, one line refuses to wrap, and there's a strange gap where a space should be. Or you drop AI-generated copy into your website's CMS and the apostrophes come out as garbled question marks. Or you paste into a code comment and your linter throws a fit over a character you can't even see. What's happening in all these cases is the same: the text you copied isn't just letters and spaces. It's carrying invisible baggage — characters that live between the visible glyphs, doing things you never asked for.
This is one of the most under-discussed side effects of working with AI-generated and rich-text-formatted content. Large language models were trained on typeset text from the web, from books, from professionally formatted documents. That text is full of typographic niceties: curly quotation marks, em-dashes, non-breaking spaces, special apostrophes. When a model reproduces that style, it reproduces those characters too. Then rich-text editors — Google Docs, Microsoft Word, Notion, most web-based chat interfaces — pile on their own invisible additions during copy and paste. The result is that "plain text" you thought you had is anything but plain.
This guide walks through exactly what those hidden characters are, why they show up, how to make them visible, and — the part you actually came for — several concrete, tested ways to strip them out depending on where you're working. I'll also be straight with you about one thing near the end: cleaning invisible characters is good formatting hygiene, but it is not a magic trick for fooling AI detectors. Let's start by naming the enemy.
What "hidden characters" actually means
Every character you type or paste is stored as a code point in the Unicode standard — a number that identifies it uniquely. The letter "A" is U+0041. A regular space is U+0020. Most of the time you never think about this because the visible characters map neatly to what you see. Hidden characters are the ones that occupy space in the file but either render as nothing, render as an ordinary-looking space, or render as a slightly different-looking version of a character you expected. Here are the usual suspects.
Non-breaking space (U+00A0)
The non-breaking space looks identical to a normal space on screen, but it behaves differently. Its whole purpose is to prevent a line break at that point — it "glues" the words on either side together so they stay on the same line. Typographers use it deliberately (for example, between a number and its unit, like "10 kg"). The problem is that AI tools and rich editors sprinkle them in unpredictably. When you later run a find-and-replace looking for a normal space, it won't match. When your text wraps, one word inexplicably jumps to the next line. When you count characters, the total is off. This is probably the single most common invisible troublemaker in pasted AI text.
Zero-width characters (U+200B, U+200C, U+200D, U+FEFF)
These take up no visual width at all. You literally cannot see them, and your cursor can pass over them as if they were nothing. The zero-width space (U+200B) is meant to suggest an allowed line-break point without adding visible space. The zero-width non-joiner (U+200C) and zero-width joiner (U+200D) control how adjacent characters connect — the joiner is what stitches emoji sequences together, for instance. The byte-order mark (U+FEFF), when it wanders into the middle of text, is another zero-width gremlin. Because they're invisible, they're the hardest to diagnose. You'll notice their effects — a word count that seems too high, a search that fails to find a phrase you can clearly see, code that won't compile — long before you notice the characters themselves.
Smart (curly) quotes: U+2018, U+2019, U+201C, U+201D
These are the "typographer's quotes" that curve toward the text: left and right single quotes (U+2018 and U+2019) and left and right double quotes (U+201C and U+201D). They look polished in a document. They cause chaos in a code editor, a spreadsheet formula, a URL, a JSON file, or any system expecting the plain straight quote (U+0022 for double, U+0027 for single). If you've ever pasted a command from a chat window into a terminal and gotten a baffling syntax error, curly quotes were very likely the reason.
The apostrophe problem (U+2019)
The right single quotation mark (U+2019) deserves its own mention because it doubles as the "smart" apostrophe. AI tools love it. So when you type "don't" it may come back as "don't" using U+2019 instead of the straight apostrophe U+0027. Visually the difference is subtle. Functionally it breaks contractions in search, sorts words incorrectly in databases, and shows up as mojibake (garbled symbols) when the text moves between systems with mismatched character encoding.
Em-dashes and en-dashes: U+2014 and U+2013
The em-dash (U+2014, the long one — like this) and the en-dash (U+2013, the medium one used for ranges, 5–10) are legitimate punctuation. They're not "wrong." But heavy, reflexive em-dash use has become one of the more talked-about stylistic tells of AI writing, and many people prefer to convert them to a hyphen with spaces, or to restructure the sentence. Whether you strip them is a style choice, not a correctness issue — but they belong on this list because "remove the AI-flavored punctuation" is a common part of the same cleanup pass.
Exotic whitespace and other oddities
Beyond the non-breaking space, Unicode defines a whole family of whitespace characters that can slip in: the en space (U+2002), em space (U+2003), thin space (U+2009), narrow non-breaking space (U+202F), and the ideographic space (U+3000) common in East Asian text. You'll also occasionally meet soft hyphens (U+00AD, an invisible "break here if needed" marker) and horizontal ellipsis characters (U+2026, a single glyph "…" instead of three periods). None of these are visible as themselves, and all of them can trip up formatting, searching, or downstream processing.
Why AI tools and editors insert them in the first place
It helps to understand the "why," because it tells you how to prevent the mess as well as clean it. There are three distinct sources.
The model reproduces trained typography. Language models learned from text that was, overwhelmingly, professionally formatted. Published articles use curly quotes and em-dashes as a matter of house style. So the model, imitating that style, generates the same characters. It isn't a bug — it's the model faithfully echoing what "good writing" looked like in its training data. This is the source of your curly quotes, smart apostrophes, ellipsis glyphs, and em-dashes.
The rendering layer adds display characters. Chat interfaces and rich editors render your text in HTML. To control spacing and prevent awkward wrapping, they inject non-breaking spaces and occasionally zero-width characters into the displayed markup. When you select and copy from that rendered view, you copy those injected characters along with the words. This is why the same sentence can be clean when typed into a plain text box and dirty when copied out of a chat bubble.
Copy-and-paste carries formatting metadata. When you copy from a rich source, your clipboard holds several versions of the content — plain text, HTML, sometimes RTF. Paste into another rich editor and it grabs the HTML version, dragging along styling, hidden markup, and every invisible character embedded in it. The words survive the trip, but so does the baggage. This is the mechanism behind most "why does my pasted text look weird" complaints, and understanding it points straight at the simplest fix, which we'll cover first.
How to see the invisible before you remove it
You can't reliably clean what you can't detect, so build the habit of checking. A few practical ways to make hidden characters visible:
- Turn on formatting marks in your word processor. In Microsoft Word, click the pilcrow button (¶) on the Home tab, or press
Ctrl+Shift+8. Spaces show as dots, and while a normal space and a non-breaking space both show as dots, the non-breaking one appears as a slightly raised, degree-like dot. It's a start. - Paste into a strict plain-text editor. Windows Notepad and similar bare editors will surface encoding problems — mojibake, replacement characters (the � symbol) — the moment they can't represent something cleanly.
- Use a code editor with whitespace rendering. Editors like VS Code can render whitespace and will often flag or highlight unusual Unicode characters. Turn on "Render Whitespace" and enable Unicode highlighting; suspicious characters get boxed or colored.
- Run a character count sanity check. If a word counter reports more characters than you can account for, invisible characters are hiding in the gaps. This is a fast smoke test even when you can't see the culprits directly.
- Search for the specific code point. In any tool that supports Unicode-aware find (more on this below), searching for
orwill jump straight to the offenders and confirm they exist.
Once you know something's there — or you just want to be safe by default — pick the removal method that matches where you're working.
Method 1: Paste as plain text (the 90% solution)
If you remember one thing from this entire guide, remember this: most hidden-character problems are introduced at the moment of pasting, and most of them are prevented by pasting without formatting. Instead of a normal paste, use the plain-text paste command, which discards the HTML/RTF version of the clipboard and keeps only the raw text — stripping styling and, crucially, most of the display-injected invisible characters along with it.
- Copy your AI text as usual.
- Click into your destination.
- Press
Ctrl+Shift+Von Windows, orCmd+Shift+Von Mac, instead of the usual paste shortcut. - Verify the result — check spacing and quotes look right.
A few caveats worth knowing. First, the exact behavior of plain-text paste varies by application; in some apps it's called "Paste and Match Style" or "Paste Without Formatting," and it may sit under the Edit menu rather than a shortcut. Second, plain-text paste reliably kills non-breaking spaces and zero-width characters that were part of the rich markup, but it does not convert curly quotes or em-dashes into straight quotes and hyphens — those are real text characters, not formatting, so they survive. For those you'll need one of the find-and-replace methods below. Still, for the everyday "just make this paste normally" problem, plain-text paste is the fastest, lowest-effort tool you have. If you want the full cross-device treatment — including mobile, where the shortcut differs — the walkthrough at how to clean ChatGPT text on any device covers each platform's quirks in detail.
Method 2: Find & Replace in Google Docs and Word
When you need to convert real characters — curly quotes to straight, em-dashes to hyphens, non-breaking spaces to normal spaces — find-and-replace is the workhorse. The trick is knowing what to search for, because you can't always type these characters directly into a search box.
In Google Docs
Google Docs supports regular-expression search, which lets you target invisible characters by code. Open Edit > Find and replace, then tick the Match using regular expressions box.
- To remove non-breaking spaces, search for
\x{00a0}(or, more simply, paste a copied non-breaking space into the Find field) and replace with a single normal space. - To remove zero-width spaces, search for
\x{200b}and replace with nothing (leave the Replace field empty). - To convert curly double quotes to straight, search for
[\x{201c}\x{201d}]and replace with a straight double quote. - To convert curly single quotes and smart apostrophes, search for
[\x{2018}\x{2019}]and replace with a straight apostrophe. - To convert em-dashes, search for
\x{2014}and replace with a hyphen or a spaced hyphen, per your preference.
One important sequencing note: do the invisible-space replacements before you do anything that relies on word boundaries, and do each replacement one at a time so you can see the count of changes and catch surprises. Google Docs also has an autocorrect setting under Tools > Preferences that re-inserts smart quotes as you type — turn off "Use smart quotes" there if you want your cleanup to stick.
In Microsoft Word
Word's find-and-replace uses caret codes rather than regex-style escapes. Open Find and Replace with Ctrl+H, and for the special ones click More > Special to insert codes, or type them directly:
- Non-breaking space is
^sin the Find field; replace with a normal space. - To handle a specific Unicode code point, type
^ufollowed by the decimal value — for example^u8203targets the zero-width space (U+200B is 8203 in decimal). Replace with nothing to delete it. - For curly quotes, the cleanest route is to turn off File > Options > Proofing > AutoCorrect Options > AutoFormat As You Type > "Straight quotes with smart quotes," then run a find-and-replace of
"with"and'with'. With the autoformat off, Word leaves them straight instead of re-curling them. - Em-dash is
^+and en-dash is^=in the Find field.
If your specific pain is AI text landing in Google Docs and behaving strangely — bullets that won't align, spacing that fights you, quotes that keep re-curling — there's a dedicated, step-by-step fix at how to fix ChatGPT formatting in Google Docs that goes deeper than a single find-and-replace pass.
Method 3: The plain-text round-trip
Sometimes the fastest way to strip everything is to force the text through a container that cannot hold hidden formatting. A basic plain-text editor is exactly that container. The technique, often called the "Notepad round-trip," works like this:
- Open a bare plain-text editor — Windows Notepad, TextEdit set to plain text mode on Mac, or any code editor's plain text file.
- Paste your AI text into it.
- Select all (
Ctrl+A) and copy (Ctrl+C) the text back out. - Paste it into your real destination.
The round-trip guarantees the removal of any formatting that a plain-text file structurally can't store, which knocks out rich-text-embedded invisible characters. Be aware of two limits. On Mac, TextEdit defaults to rich text, so you must switch it to plain text via Format > Make Plain Text first, or the trick does nothing. And just like plain-text paste, this method removes formatting-layer invisibles but leaves genuine text characters — curly quotes, em-dashes, smart apostrophes — untouched, because those are legitimate parts of the plain text. Pair the round-trip with a find-and-replace pass when you need those converted too. The round-trip's virtue is speed and universality: it needs no special tools and works identically on almost any computer.
Method 4: Regex for the technical crowd
If you're comfortable with a code editor, a terminal, or a scripting language, regular expressions give you the most precise control. You can target exactly the characters you want, in one pass, and leave everything else alone. The general strategy is to match a character class of the offenders and replace it with nothing (for deletions) or with the plain equivalent (for conversions).
A common cleanup pattern, in a find-and-replace that supports Unicode escapes, looks like this. To delete zero-width and byte-order-mark characters entirely, match [-] and replace with an empty string. To normalize non-breaking and exotic spaces down to a regular space, match a class such as [ - ] and replace with a single space. To straighten quotes, replace [‘’] with a straight apostrophe and [“”] with a straight double quote. To flatten dashes, replace [–—] with a hyphen. To turn the ellipsis glyph into three dots, replace … with three periods.
Two professional habits make this safe. First, apply deletions and conversions in a deliberate order, and consider running a Unicode normalization step (many languages expose an "NFC" or "NFKC" normalize function) which collapses many compatibility variants into canonical forms in a single, well-tested operation — often doing most of the job before you write a single custom pattern. Second, always keep a copy of the original until you've verified the output, because a too-greedy character class can eat something you meant to keep, such as a legitimate accented letter that happens to sit in a range you specified carelessly. Test on a sample, check the diff, then run it on the full text.
Method 5: A dedicated text cleaner
Everything above is manual. If you clean AI text more than occasionally, doing this by hand every time is tedious and easy to get wrong — you'll forget the zero-width pass one day and ship a broken paragraph. A purpose-built text cleaner runs all of these normalizations in one shot: it strips zero-width characters, collapses odd whitespace to normal spaces, straightens quotes, flattens dashes and ellipses, and hands you back clean, portable plain text. Paste in, copy out, done.
The advantage of a dedicated cleaner isn't that it does something you couldn't do manually — it's consistency and speed. It applies the same rules every time, so you don't have to remember the full checklist or maintain a personal regex. If you'd rather trigger that cleanup without even opening a browser tab, the guide on how to set up a one-tap text cleaner on iPhone shows how to wire a cleaner into a mobile shortcut so the whole pass happens with a single tap from your share sheet. For desktop workflows, keep a cleaner bookmarked as the last stop before text goes anywhere it matters.
A necessary caution: cleaning is hygiene, not a detector bypass
Here's where I have to be honest with you, because a lot of content on this topic quietly implies otherwise. Removing hidden characters is genuinely useful — it fixes formatting, prevents broken pastes, kills encoding errors, and removes one small, incidental signal that text passed through an AI tool. But it will not make AI-generated writing pass as human to a serious AI detector. Those are two completely different problems.
AI detectors do not primarily hunt for zero-width spaces or curly quotes. They analyze the wording: sentence-length variation, word-choice predictability, phrasing patterns, the statistical fingerprint of how the text was assembled. Stripping invisible characters changes none of that. You can hand a detector immaculate, invisible-character-free plain text and it will still evaluate the same underlying prose it always would. If you want to understand what these systems actually measure, the breakdown at what do AI detectors look for lays out the real signals — and it makes clear why a formatting pass is orthogonal to detection. For the broader and more honest picture of what is and isn't achievable, can you bypass AI detectors is worth reading before you invest effort in the wrong place.
So set your expectations correctly. Clean your text because you want it to paste properly, look consistent, and not betray formatting glitches in professional contexts. Those are excellent, legitimate reasons. Just don't clean it believing you've defeated a detector, because you haven't touched the thing a detector reads. Treating hidden-character removal as a bypass strategy is how people end up confidently submitting text that gets flagged anyway.
Quick reference: what to strip and how
Keep this list handy. When something looks off in pasted AI text, run down it in order:
- First, paste plain. Use
Ctrl+Shift+V/Cmd+Shift+V. This alone solves the majority of spacing and invisible-character problems by preventing them at the source. - Non-breaking spaces (
U+00A0): find-and-replace to a normal space, or let plain-text paste handle them. - Zero-width characters (
U+200B,U+200C,U+200D,U+FEFF): delete via regex[-]or a cleaner tool; a plain-text round-trip catches the markup-embedded ones. - Curly quotes (
U+201C,U+201D) and smart apostrophes (U+2018,U+2019): convert to straight quotes with find-and-replace, and turn off smart-quote autocorrect so they don't come back. - Em/en-dashes (
U+2014,U+2013): convert to hyphens if your style calls for it — a judgment call, not a fix. - Exotic whitespace (
U+2002,U+2003,U+2009,U+202F,U+3000) and ellipsis glyphs (U+2026): normalize to normal spaces and three dots, ideally with a Unicode normalization pass or a dedicated cleaner. - Always verify. Re-check spacing, quotes, and character count after cleaning, and keep the original until you've confirmed the result.
The through-line of all of this is simple: the invisible characters in AI text are a formatting problem with formatting solutions. Prevent most of them by pasting plain, convert the visible-but-sneaky ones with find-and-replace or a cleaner, reach for regex when you need surgical control, and verify your work before it ships. Do that, and your AI-assisted text will paste, wrap, sort, and display exactly the way you intended — no gremlins in the gaps, no baffled colleagues, and no mysterious symbols where your apostrophes used to be. Just clean, portable, well-behaved text that goes wherever you send it and looks the same when it lands.