You have built an order confirmation, a newsletter or a password-reset email. It looks right in your code editor's preview. Then it lands in an inbox with the footer cut off behind a "View entire message" link, images replaced by empty boxes, and a layout squeezed onto a phone screen. Email is one of the least forgiving places to publish HTML, because every client applies its own rules.
This guide explains why email HTML behaves differently from web pages, walks through a testing routine that catches most problems before you send, and shows how to check size, images, links and mobile layout in your browser.
Why email HTML is different
A web page runs in a modern browser you can more or less predict. An email is displayed by dozens of different clients: webmail services in a browser, desktop programs and phone apps. Each one:
- Strips or rewrites code. JavaScript never runs in email. Forms are often disabled. Some clients remove
<style>blocks in certain situations, and many ignore external stylesheets linked with<link>. - Uses its own rendering engine. Some versions of Outlook for Windows have historically used a Word-based engine with limited CSS support, which is why table-based layouts are still common in email.
- Blocks images by default in some configurations, showing the
alttext instead until the reader allows images. - Applies dark mode in different ways: some leave your colours alone, some invert light backgrounds, some only adjust certain elements.
The result is a set of conservative habits: inline CSS, tables for layout, a maximum width around 600 pixels, absolute https:// image URLs, and meaningful alt text.
The Gmail clipping limit
Gmail clips messages whose HTML is larger than about 102 KB. Everything after the cut is hidden behind a "View entire message" link. That usually means your footer, including the unsubscribe link and legal text, disappears from view, and any tracking pixel placed near the end may not load.
The limit applies to the HTML source, not to images, which load separately. Common causes of oversized HTML are:
- Very long inline styles repeated on every element.
- Templates built by drag-and-drop editors with deeply nested tables.
- Embedded images as base64 data URIs.
- Long tracking URLs on every link.
- Leftover comments and whitespace.
Test a template with the Email Template Previewer
Our Email Template Previewer renders your email at desktop and mobile widths and runs a set of checks.
- Open the Email Template Previewer. A sample shipping notification is loaded.
- Paste your template's HTML into Email HTML, or click Open .html file.
- Read the tiles: HTML size (with a warning if it is over 102 KB), the number of Images and Links, and the Subject / title taken from the
<title>tag. - Choose a view: Desktop + mobile side by side, or Desktop or Mobile on its own. The mobile frame is 375 pixels wide.
- Switch on Dark background to see your email on a dark canvas. This shows how transparent images and light edges look against dark surroundings. It does not simulate each client's colour inversion.
- Work through the checklist under the preview. It flags size over the clipping limit, images without
altattributes,<script>tags, forms, external stylesheets,http://URLs and links with empty or#targets.
The preview runs with scripts disabled, using your browser's engine. It is fast for layout and content checks; a real test send is still needed for client-specific quirks.
A testing routine that catches most problems
- Preview at both widths. Confirm columns stack on mobile, text is at least 14 to 16 pixels, and buttons are large enough to tap.
- Check the size. Stay comfortably under 102 KB so small changes do not tip it over. Minify with the HTML Minifier if needed, but keep a readable source copy.
- Read it with images off. Every image needs alt text, and the key message and call to action should work as live text, not only inside an image.
- Click every link. Look for placeholder
#links, wrong domains and missing tracking parameters. - Send real tests. Send to the main clients your audience uses, on both desktop and phone. Paid services can generate screenshots from many clients at once if you need wide coverage.
Writing email HTML that survives
A skeleton that works across most clients uses a centred table with a fixed maximum width:
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:#f3f4f6;">
<tr>
<td align="center" style="padding:24px 12px;">
<table role="presentation" width="600" cellpadding="0" cellspacing="0" style="max-width:600px;width:100%;background:#ffffff;">
<tr>
<td style="padding:24px;font-family:Arial,sans-serif;font-size:16px;line-height:1.5;color:#1f2937;">
Your order has shipped.
</td>
</tr>
</table>
</td>
</tr>
</table>
role="presentation" tells screen readers the table is for layout, not data. Inline styles ensure the most important formatting survives clients that drop <style> blocks.
Other ways to test emails
Your email platform's preview
Most sending platforms have a preview and test-send feature. Their previews are usually browser renders like ours; the test send is the valuable part.
Browser developer tools
Opening the HTML in a browser and using device mode is fine for layout. It will not flag email-specific issues such as size limits, external stylesheets or forms.
Screenshot services
Commercial email testing services render your message in many real clients and devices. They are the most thorough option and worth it for high-volume campaigns.
Troubleshooting
Images do not show
Relative paths like images/banner.png do not work in email; every src must be a full https:// URL on a public server. Also check that the image host is not blocking hotlinking.
Layout breaks in some desktop clients
Flexbox, grid and many modern CSS properties are unsupported in some clients. Rebuild the structure with nested tables, and use width attributes as well as CSS widths.
Styles disappear
Move critical CSS inline. Keep media queries in a <style> block in the head for clients that support them, but make sure the email still looks acceptable without them.
Colours look wrong in dark mode
Avoid images with white boxes around logos; use transparent PNGs with a subtle outline or light padding. Test with Dark background and on a real phone in dark mode. For reusable layout pieces, the HTML Table Generator produces clean table markup, and the Email Signature Generator builds signatures in the same table-based style.
Frequently asked questions
What is Gmail's size limit for HTML emails?
Gmail clips messages whose HTML exceeds roughly 102 KB and hides the rest behind a link. Images are not counted because they load separately.
Can I use JavaScript in an email?
No. Email clients strip or ignore scripts for security reasons. Any interactivity has to be done with links to a web page.
Why should email layouts use tables?
Some widely used clients have limited CSS support, and tables are the most reliable way to create columns and centred containers across all of them.
Does the dark background option show exactly what dark mode will look like?
No. It places your email on a dark canvas so you can spot problems at the edges and around images. Each client applies dark mode differently, so test on real devices too.
Is my email template uploaded?
No. The template is rendered and analysed in your browser, so customer data in test templates stays on your device.