Gmail doesn't have a built-in button to export an email as HTML, but you can copy the raw code in three ways: through Gmail's developer tools, by forwarding to a text editor, or by using a third-party tool that reads Gmail's API

The fastest method for most people is opening the email, clicking the three-dot menu, selecting "Show original," then copying everything you see. That raw code includes all the HTML, CSS, and metadata that makes up the email. You can paste it into a text editor, save it with a .html file extension, and open it in any browser to see the email exactly as it appeared.

The other methods work if you need the HTML in a specific format, want to automate the process for many emails, or prefer not to use your browser's developer tools. Each has trade-offs between speed, technical skill required, and what you end up with.

Key Takeaways

  • The "Show original" option in Gmail's three-dot menu displays the complete HTML source code of any email, which you can copy and save as a .html file.
  • Saving HTML this way preserves the email's structure and styling but not embedded images — those remain as links to their original location.
  • If you need images included in the saved file, you will need to read them separately or use a third-party tool designed for email archiving.
  • The HTML you save can be opened in any web browser and edited in any text editor, giving you a portable copy of the email independent of Gmail.

Using Gmail's "Show Original" to get the raw HTML

Open the email you want to save. Click the three-dot menu icon in the top right corner of the email (not the Gmail toolbar — the menu specific to that message). Select "Show original" from the dropdown.

A new tab or window opens showing the complete email source code. This includes the HTML markup, CSS styling, email headers (sender, recipient, date, subject), and any attachments listed as code. Select all the text with Ctrl+A (Windows) or Command+A (Mac), then copy it with Ctrl+C or Command+C.

Open a text editor — Notepad on Windows, TextEdit on Mac, or any code editor like VS Code or Sublime Text. Paste the code. Save the file with a .html extension (for example, email_from_client.html). You can now open this file in any web browser and see the email rendered as it appeared in Gmail, or edit the HTML directly if you need to change it.

What the HTML includes and what it doesn't

The HTML you copy from "Show original" includes the complete structure of the email: all text, links, formatting, colors, fonts, and layout. It also includes email metadata like the sender's address, timestamp, and subject line encoded in the header section. If the email contains tables, buttons, or complex formatting, all of that comes through.

Embedded images do not transfer as actual image files. Instead, the HTML contains links pointing to where those images live on Gmail's servers or the sender's server. When you open the saved HTML file in a browser, the images load from those links if you have an internet connection. If you lose internet access or the original image is deleted, the image link breaks and shows a broken-image icon.

Attachments (PDFs, Word documents, spreadsheets) are not included in the HTML file itself. The "Show original" view lists them as metadata, but you cannot access them from the saved HTML. You need to read attachments separately from Gmail if you want to keep them.

Saving the HTML file so you can find it later

After you save the .html file to your computer, treat it like any other document. Put it in a folder where you keep important records — a "Saved Emails" folder, a project folder, or your Documents directory. Give it a clear name that includes the sender's name or the email's subject, plus the date if you receive similar emails often.

If you save many emails this way, consider creating a folder structure: one folder per sender, or one per project, or one per year. This makes it much easier to find a specific email six months later than if you dump all of them in one folder with generic names like "email1.html" and "email2.html".

The .html file is just text, so it takes up very little space on your hard drive — usually less than 100 kilobytes per email. You can back it up to cloud storage (Google Drive, Dropbox, OneDrive) the same way you would back up any other file. This gives you a copy independent of Gmail, which is useful if you need the email for legal or financial records.

Using third-party tools if you need images included

If you need the images embedded in the HTML file itself rather than linked, or if you want to save many emails at once, third-party tools can do this. Tools like Gmail Backup, Takeout (Google's own export tool), or Mailstrom can read your emails in different formats, including HTML with images embedded as base64 code.

Google Takeout is free and official — it exports your entire Gmail account or specific labels to a .mbox file (a standard email archive format). You can then convert that .mbox file to HTML using free tools like Thunderbird (an email client) or online converters. This process takes longer than "Show original" but gives you a complete backup of your email account.

Third-party backup services usually charge a monthly fee and require you to grant them access to your Gmail account through Google's permission system. They are most useful if you need to save hundreds of emails regularly or want automatic backups. For saving one or two emails, the "Show original" method is faster and requires no sign-ups.

Editing the HTML after you save it

Once you have the HTML file, you can open it in any text editor and change it. You might remove a signature you do not want to keep, change colors, delete a section, or add notes. Save your changes and the next time you open the file in a browser, you see the updated version.

If you are not comfortable editing HTML directly, you can also open the file in a WYSIWYG editor like Bluefish or Komodo Edit, which let you edit the email visually without touching the code. Be careful not to save over the original file if you want to keep a copy of the email as it was — use "Save As" instead and give it a new name.

Frequently Asked Questions

Will the saved HTML file look exactly like the email in Gmail?

Usually yes, but sometimes no. The HTML renders in your browser the same way Gmail displayed it, but browser rendering can vary slightly. If the email uses custom fonts or very specific styling, it might look slightly different in Firefox versus Chrome. Images load from their original location, so if the sender's server goes down, the images disappear.

Can I send the saved HTML file to someone else?

Yes. You can email the .html file as an attachment, share it via cloud storage, or post it online. When they open it in a browser, they see the email. They can also edit it or save it again. The file is portable and does not require Gmail or any special software to view.

What if I want to save just the text without any HTML code?

Copy the email text directly from Gmail and paste it into a text editor, then save as a .txt file. This strips all formatting and images but gives you a plain-text version. You lose colors, links, and layout, but the words remain readable and searchable.

Does saving the HTML use up my Gmail storage?

No. Saving the HTML file stores it on your computer or cloud storage, not in Gmail. Your Gmail storage limit is unchanged. The original email remains in your Gmail account unless you delete it.

Can I convert the HTML back into a Gmail email?

Not directly. You cannot import a .html file back into Gmail as a new email. You can copy the text from the HTML file and paste it into a new Gmail draft, but you will lose the original formatting. If you need to preserve the email in Gmail itself, use Gmail's archive or label features instead of saving it elsewhere.