View the Source of a Message in Gmail

Discover the technical details behind your email messages

An email you see in Gmail is not really what the actual original email looks like, at least, not the one that the email program interprets when it receives it. Instead, there's a hidden source code that you can peer into to see some additional information not included in the regular message.

The source code of the email shows the email header information and often also the HTML code that controls how the message is to be displayed. This means you get to see when the message was received, the server that sent it, and lots more.

You can view the full source code of an email only while using the desktop version of Gmail or Inbox. The mobile Gmail app does not support viewing the original message. 

How to View the Source Code of a Gmail Message

  1. Open the message you want to see the source code for.

    A message in Gmail
  2. Locate the top of the email where the subject, sender details, and timestamp are located. Right next to that is the reply icon, you'll see the three stacked dots for the menu. Press the icon to reveal the additional options.

  3. Select Show original from that menu to open a new tab displaying the email's source code.

    Show original option in Gmail
  4. The original source code of the message will open up in a new tab. At the top, you'll find vital details for the message and how it was sent. Below, is the actual plain text that was exchanged between email servers.

    Original message window in Gmail
  5. Email messages contain a lot of information that servers use to ensure that the message makes it to the correct place. You can use your browser's search function to find the beginning of the actual message. Because the message is HTML, it should begin with an HTML <!DOCTYPE html> tag. So, open the search with Ctrl+F. Then, search for "DOCTYPE" to get to the beginning of the message content.

    Original source example in Gmail
  6. To download the original message as a TXT file, you can use Download Original. Or, select Copy to clipboard to copy all the text so that you can paste it anywhere you like.