Why Gmail Strips Your Custom Formatting on Send
Why Gmail Strips Your Custom Formatting on Send - Practical tips from the PasteClean team.

You spend twenty minutes crafting the perfect project update. You bold the KPIs, carefully indent the timeline, and paste a table from Excel that finally looks readable. You hit send with confidence, only to check your "Sent" folder five minutes later and see a disaster: the fonts have reverted to different sizes, the table is blown out, and your bullet points have turned into weird, unaligned squares.
This isn't just bad luck; it is a predictable technical collision between the source code of your clipboard and Gmail’s aggressive rendering engine.
Most professionals assume that the Gmail composer works like a simplified version of Microsoft Word. It doesn't. It works like a 1990s web browser that barely tolerates modern CSS. When you encounter gmail strip formatting issues, it is usually because the HTML structure behind your text violates Gmail’s strict sanitization rules.
Here is the technical breakdown of why your emails break upon sending, and how to stop fighting the rendering engine.
The HTML Sanitizer: Gmail Doesn't Trust You
To understand gmail send issues, you have to understand the environment your email lives in. When you send an email, you aren't sending a static document (like a PDF). You are sending a block of HTML code that has to live inside the recipient's inbox.
If Gmail allowed any HTML or CSS to pass through, bad actors could embed scripts to steal cookies, overlay fake login windows, or break the layout of the entire Gmail interface. To prevent this, Gmail runs every email through a sanitizer (specifically, the Google Caja sanitizer or its modern derivative) before rendering it.
The Head vs. Body Problem
Modern web design relies on a <head> section where styles are defined globally (e.g., "make all paragraphs gray"). Gmail strips the <head> entirely. If your formatting relies on global CSS classes—which is how Notion, Google Docs, and most AI generators structure their text—that formatting vanishes the second you hit send.
Gmail only consistently respects inline CSS.
What fails (Global CSS):
<style>
.highlight { color: red; font-weight: bold; }
</style>
<p class="highlight">This text loses its formatting in Gmail.</p>
What works (Inline CSS):
<p style="color: red; font-weight: bold;">This text stays red and bold.</p>
When you copy from a modern tool and paste into Gmail, you are often pasting text dependent on classes. Gmail ignores the class references, and your text reverts to the default styling.
The "Paste" Payload: What You Don't See
The most common cause of broken email formatting is "dirty" clipboard data. When you copy text from Microsoft Word, Excel, or ChatGPT, you aren't just copying text. You are copying a bloated mess of proprietary metadata.
The Microsoft Office Bloat
Microsoft Word is notorious for wrapping text in XML namespaces and conditional comments designed solely for other Microsoft products. If you look at the source code of a simple sentence copied from Word, you will see tags like <o:p>, <xml>, and endless spans of mso-style-priority.
Gmail’s parser chokes on these proprietary tags. Sometimes it strips them cleanly; other times, it fails to close a tag properly, causing the formatting to "bleed" into the rest of your email. This is why you sometimes see your signature font suddenly change to match the body text of a pasted paragraph.
The AI Background Problem
If you copy directly from ChatGPT or Claude, you are often copying a semantic background color. AI interfaces are built on dark or off-white modes. When you paste that into Gmail, you are inadvertently pasting a background-color CSS property wrapped around your text.
Pro Tip: If you see a recipient reply to your email and your original text is surrounded by a faint gray or white box, you pasted a background color attribute that Gmail preserved, which is now clashing with the recipient's theme.
Why the "Remove Formatting" Button Fails You
When things look wrong, the instinct is to highlight everything and click Gmail’s "Remove Formatting" button (the struck-through T icon). While logical, this often creates more work.
The native "Remove Formatting" tool is a nuclear option. It doesn't just strip the "bad" styles; it strips semantic structure.
- It removes bold and italics you wanted to keep.
- It often kills hyperlink styling (making links look like plain text).
- It flattens header tags (H1, H2) into plain paragraph text.
You are left with a wall of plain text that you now have to re-format manually. This is inefficient. You don't want to remove all formatting; you want to clean the HTML syntax while preserving the visual hierarchy. This is the precise gap that tools like PasteClean fill—sanitizing the code without destroying the user experience.
The Dark Mode Inversion Algorithm
If you are trying to fix gmail layout issues, you cannot ignore Dark Mode. Roughly 30-40% of users view emails in Dark Mode, and Gmail’s handling of this is aggressive.
Gmail does not just swap black for white. It uses a complex inversion algorithm that analyzes the contrast of your text against the background.
The Hex Code Trap
If you manually set a font color to "Black" (#000000) or a background to "White" (#FFFFFF) in your editor, you are hard-coding a value that Gmail’s Dark Mode struggles to override.
- Scenario: You paste text with a hard-coded white background style (
background-color: #ffffff). - Result: In Dark Mode, Gmail turns the email body dark gray. However, because your text has a specific inline style for a white background, that block remains white. The text, however, might be inverted to light gray by the algorithm.
- The Look: Light gray text on a white background—completely unreadable.
To avoid this, you must ensure your text has no background color defined in the HTML, allowing it to be transparent and inherit the user's theme.
Font Stacks and the "Times New Roman" Fallback
Nothing screams "unprofessional" like an email that starts in Sans Serif and switches to Times New Roman halfway through. This happens because of broken font stacks.
Web browsers cannot display a font unless that font is installed on the user's local machine or loaded via a web server. Gmail does not allow you to import external web fonts (like Google Fonts) for security reasons.
If you paste text formatted in "Proxima Nova" or "Inter" from your design tool, and the recipient is on a Windows PC that doesn't have those fonts installed, the browser looks for a fallback. If the HTML doesn't specify a generic fallback (like sans-serif), the browser defaults to its base font: usually Times New Roman.
The Fix: Always force your email composer to use "System Safe" fonts (Arial, Verdana, Helvetica, Georgia). If you must paste from elsewhere, you need a cleaner that rewrites the font-family CSS to a safe stack.
Image Resizing and the Max-Width Myth
Images are the single biggest breaker of email layouts. In modern web development, we control image sizes using CSS properties like max-width: 100%. This ensures an image shrinks to fit a mobile screen.
Gmail, specifically the Outlook desktop client rendering engine (Word) and some versions of Gmail, often ignores max-width if it is applied via a stylesheet.
If you paste an image that is 1200 pixels wide, and you rely on CSS to make it look small in your composer, the recipient might see the full 1200-pixel wide image. This forces a horizontal scrollbar and breaks the reading pane.
Technical Insight: For consistent rendering across Gmail and Outlook, images must have physical width and height attributes inside the <img> tag, not just in the CSS style string.
The Table Layout Collapse
Tables are the only reliable way to structure complex layouts in email (columns, side-by-side text), but they are fragile.
When you copy a table from Excel or Google Sheets, you are pasting thousands of lines of code. Excel includes data-binding attributes and specific column widths calculated for a spreadsheet view, not an email view.
When Gmail renders this:
- It attempts to respect the fixed pixel widths from Excel.
- If those widths exceed the email reading pane (usually ~600px), the table gets cut off.
- On mobile, Gmail may attempt to auto-scale the table, causing text to wrap vertically into single-letter columns.
To fix gmail layout problems with tables, you must strip the table of fixed pixel widths and convert them to percentage-based widths (e.g., width="100%").
Before and After: The Invisible Code
To visualize why gmail strip formatting happens, let’s look at the code.
The "Dirty" Paste (from MS Word):
<p class="MsoNormal" style="margin-bottom:0in;line-height:normal">
<span style="font-size:12.0pt;font-family:"Times New Roman",serif;
mso-fareast-font-family:"Times New Roman"">
<b>Project Alpha Update</b>
</span>
</p>
Why it fails: Reliance on classes (MsoNormal), specific font dependencies, and mso tags.
The Cleaned Code (what PasteClean produces):
<p style="margin: 0 0 1em 0;">
<strong style="font-family: Arial, sans-serif; font-size: 16px;">
Project Alpha Update
</strong>
</p>
Why it works: Zero classes. Standard HTML tags (strong). Inline styles. System-safe fonts.
Mobile Responsiveness: The Gmail App
The Gmail mobile app (on iOS and Android) is even more restrictive than the web version. It frequently strips <style> blocks entirely and ignores media queries unless the email is coded with very specific, developer-level hacks.
If you format an email with small text (10px or 12px), the Gmail app may automatically "inflate" the text size to make it readable, which can break your line heights and alignment.
The Rule of Thumb: Never use font sizes smaller than 14px for body text. This prevents the Gmail app from applying auto-scaling heuristics that ruin your layout.
How to Actually Fix It
You cannot change how Gmail renders email, but you can change the input. Here is the workflow to ensure your formatting survives the send button.
1. Paste as Plain Text (The Manual Way)
If you don't use a tool, get used to the shortcut Ctrl+Shift+V (Cmd+Shift+V on Mac). This pastes the text without any formatting. You will have to re-bold and re-link everything manually, but it guarantees the HTML is clean.
2. Use an Intermediary Cleaner
If you want to keep your bolds, links, and lists without the garbage code, you need a sanitizer. This is where a tool like PasteClean is essential. It parses the clipboard, removes the mso- tags, strips the background colors and classes, but rewrites the semantic HTML (bold, italics, lists) into Gmail-friendly inline styles.
3. Simplify Your Signature
Often, the formatting break happens because of an unclosed tag in your email signature. Go to your Gmail
Clean your AI text instantly
Paste text from ChatGPT, Claude, or any AI tool and get clean, email-ready formatting in one click.
Try PasteClean Free