Why Gmail text is full of hidden formatting
When you copy text from Gmail, it looks clean on the surface. But underneath, Gmail embeds a surprising number of hidden formatting characters that cause real problems when you paste into code editors, CMS platforms, terminals, plain text fields, or databases.
Non-breaking spaces (U+00A0) are the most common culprit. Gmail inserts these instead of regular spaces in many positions — after punctuation, around links, and within formatted text. They look identical to normal spaces but they're a different Unicode code point. When you paste them into a database field, a search-and-replace fails. When you paste them into code, a string comparison returns false even though the text looks identical.
Smart quotes (curly quotes) are another signature Gmail issue. When you type " in a Gmail compose window, it silently becomes “ or ”. These Unicode characters look similar to straight quotes in many fonts, but they break JSON, YAML, SQL queries, Python code, shell scripts, and virtually every programming language.
Zero-width characters are completely invisible but very much present. Gmail injects zero-width spaces (U+200B), zero-width joiners (U+200D), and byte order marks (U+FEFF) around text boundaries. These inflate character counts, break string comparisons, cause unexpected behavior in parsers, and create ghost characters inside variable names or URLs when pasted into code.
Gmail also uses Windows-style line endings (CRLF: \r\n) rather than Unix-style LF (\n). When pasted into Unix or macOS environments, this creates visible ^M characters at the end of each line, double-spacing in terminal output, and noisy diffs in version control.
Common scenarios where Gmail formatting causes problems
- Pasting code snippets from email threads into your IDE or terminal — invisible characters cause
SyntaxErrororIndentationError - Copying meeting notes from Gmail into project management tools like Jira, Linear, or Notion — smart quotes render oddly
- Extracting data from email tables into spreadsheets or databases — non-breaking spaces break sorting and deduplication
- Forwarding configuration values, API keys, or URLs from emails — zero-width characters silently corrupt the strings
- Copying error messages or logs shared via email for troubleshooting — hidden characters interfere with searching and grep patterns
- Pasting customer feedback from Gmail into analytics tools — text length mismatches and encoding issues
How to tell if your text has hidden Gmail formatting
The frustrating part is that you usually can't tell by looking at it. The characters are invisible or look identical to their ASCII counterparts. Some signs to watch for: string comparisons fail on text that looks identical, character counts are higher than expected, regex patterns don't match, and copy-pasted code has mysterious syntax errors. If any of these sound familiar, paste your text into Unformat and check the stats toast — it will tell you exactly what was hiding in your text.
How Unformat cleans Gmail text
Unformat processes your Gmail text entirely in your browser and applies a comprehensive set of cleaning rules designed specifically for the formatting artifacts Gmail introduces.
In Standard mode, Unformat handles the most common Gmail issues: non-breaking spaces are converted to regular spaces, smart quotes are replaced with straight quotes, zero-width characters are stripped, line endings are normalized to LF, trailing whitespace is trimmed, multiple consecutive spaces are collapsed, and excessive blank lines are reduced to a maximum of one. This mode is ideal for cleaning email text headed for documents, notes, or messaging platforms.
In Developer mode, Unformat goes further. It removes byte order marks (BOM), converts tabs to your preferred indentation (2 spaces, 4 spaces, or keep tabs), replaces em-dashes and en-dashes with regular hyphens, removes soft hyphens, and preserves leading indentation while cleaning inline whitespace. This is the right mode when pasting code snippets, config files, or technical content from emails.
Your text never leaves your browser. Unformat uses JavaScript regex processing with no server calls, no data storage, and no tracking. You can verify this by opening your browser's network tab — you will see zero outbound requests during cleaning.
How to clean your text
- Open the email in Gmail and select the text you want to clean.
- Copy it to your clipboard (Ctrl+C or Cmd+C).
- Click the text area above and paste (Ctrl+V or Cmd+V).
- Your text is instantly cleaned — all hidden formatting is stripped. Check the stats toast for a breakdown.
- Click "Copy Clean Text" or press Ctrl+K to copy the result.
- Paste the clean text into your destination app — code editor, CMS, terminal, or database.
Frequently Asked Questions
Does Gmail always add hidden formatting when I copy text?
Yes. Every time you copy from Gmail's compose window, reading pane, or chat, Gmail includes non-breaking spaces, smart quotes, and zero-width characters in the clipboard data. This happens regardless of whether the email appears to be plain text or rich text. Even forwarded plain-text emails pick up these artifacts when displayed in Gmail's interface.
Can I prevent Gmail from adding hidden characters in the first place?
Gmail does not offer a setting to disable smart quotes or non-breaking space insertion. Even composing in "plain text mode" (More options → Plain text mode) doesn't fully prevent it, because the act of copying from Gmail's rendered HTML view reintroduces formatting. The most reliable approach is to clean the text after copying, which is exactly what Unformat does.
Is my email text sent to a server when I use this tool?
No. Unformat is 100% client-side. All cleaning happens in your browser using JavaScript. Your text never leaves your machine. You can verify this by opening your browser's Developer Tools (F12), switching to the Network tab, and watching for zero outbound requests while you paste and clean text.
What's the difference between Standard mode and Developer mode for Gmail text?
Standard mode handles the most common Gmail formatting issues: smart quotes, non-breaking spaces, zero-width characters, and line endings. Developer mode adds BOM removal, soft hyphen removal, em/en-dash replacement, and configurable tab-to-space conversion. Use Developer mode when pasting code, JSON, YAML, or config from emails.
Will this tool work on Gmail text in languages other than English?
Yes. Unformat targets Unicode formatting characters, not language-specific characters. It replaces smart quotes, removes zero-width joiners and non-breaking spaces regardless of the text language. Your actual content — letters, numbers, CJK characters, emoji — is preserved intact.