Developer Tools
HTML Email CSS Inliner
Inline CSS from style blocks into HTML email markup so Gmail, Outlook, Yahoo, and Apple Mail render the design correctly. Free, browser-only.
Paste the full HTML, including the <head> and any <style> blocks. CSS from every <style> tag is read in source order.
Up to 500,000 characters. Larger templates may slow the browser.
Options
Defaults match what most transactional email senders want. Toggle to fit your stack.
Why HTML email needs inlined CSS
- Gmail (web and mobile): keeps <style> in the head but removes any rule it cannot normalise. Anything not also inlined risks dropping.
- Older Outlook (2007 to 2019, Windows): renders mail with Word, ignores most <style> rules, and requires style attributes for almost every property.
- Yahoo Mail and Apple Mail: honour <style> reasonably well, so this tool keeps media queries and :hover rules in a single rescued block instead of silently dropping them.
- Specificity is preserved: !important and selector specificity follow the CSS cascade, so inlined output matches what a real browser shows when both rules and inline styles fight for the same property.
How to use
- Paste your HTML email source into the input area. Include the full document with the head and any style blocks.
- Use the default options for most cases. Defaults remove style blocks but keep media queries, :hover rules, keyframes, and MSO conditional comments.
- Toggle Strip class attributes or Strip id attributes only if your output is going straight to send and you do not need anchors or selectors targeting those attributes.
- Read the stats: elements styled, rules inlined, rules rescued, and the size delta. Warnings appear when a setting drops rules that could not be inlined.
- Click Copy HTML to grab the inlined output. Click Copy CSS in the rescued block if you want to inspect the leftover rules separately.
- Test the result in Litmus, Email on Acid, or by sending yourself a copy through SendGrid, Mailgun, Postmark, SES, or your stack of choice.
About this tool
HTML Email CSS Inliner converts a normal HTML email template (with rules defined inside style tags) into the inline-style format every email client renders reliably. Paste the full HTML and the tool parses the document with the browser's DOMParser, reads every style block in source order, tokenises the CSS into rules and at-rules, then computes CSS Selectors Level 3 specificity for each selector and applies declarations to matching elements through querySelectorAll. The cascade is preserved: !important wins over normal, higher specificity wins over lower, later source order breaks ties, and any preexisting inline style on an element keeps priority over stylesheet matches at equal !important level. Rules that genuinely cannot be expressed as a style attribute (media queries, :hover, ::before, ::after, @keyframes, @font-face, @supports) are not silently dropped. They are pulled into a single rescued style block that the tool reinserts at the top of head, so Apple Mail, Yahoo Mail, and Gmail web (which all honour style tags reasonably well) still see responsive layouts, link hover states, web fonts, and animations. Configurable options let you keep or remove the original style blocks, strip class and id attributes once they are no longer needed, drop ordinary HTML comments while preserving Outlook MSO conditional comments such as if mso and endif, and pick which kinds of at-rules to preserve. The output panel shows the inlined HTML ready to paste into SendGrid, Mailgun, Postmark, SES, Mailchimp, or any other transactional sender, plus a separate panel for the rescued CSS so you can inspect or copy it on its own. Stats report how many rules were inlined, how many rescued, how many had no matching element, the total declarations applied, and the input vs output byte size so you can verify the transform before sending. Everything runs locally in your browser. No upload, no external API, no tracking.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
HTML Minifier
Compress HTML safely: collapse whitespace, strip comments, drop attribute quotes, shrink boolean attributes.
Open tool
DeveloperHTML Formatter
Pretty-print and minify HTML with indent, wrap, and quote controls.
Open tool
DeveloperCSS Formatter
Beautify minified CSS with indent, brace style, and sort options.
Open tool
DeveloperCSS Minifier
Compress CSS with comment, whitespace, hex, and zero-unit optimizations and a live byte-savings readout.
Open tool
GeneratorEmail Signature Generator
Design an HTML email signature with photo, social links, and one-click copy for Gmail and Outlook.
Open tool
DeveloperEmail Validator
Validate, deduplicate, and clean lists of email addresses with typo suggestions.
Open tool