This article needs additional citations for verification. (April 2014) (Learn how and when to remove this template message)
MHTML, an initialism of MIME encapsulation of aggregate HTML documents, is a web page archive format used to combine, in a single computer file, the HTML code and its companion resources (such as images, Flash animations, Java applets, and audio and video files) that are represented by external hyperlinks in the web page's HTML code. The content of an MHTML file is encoded using the same techniques that were first developed for HTML email messages, using the MIME content type
multipart/related. MHTML files use a .mhtml or .mht filename extension.
|Internet media type|
|Type of format||Markup language|
|Standard||RFC 2557 (proposed 1999)|
The first part of the file is an e-mail header. The second part is normally HTML code. Subsequent parts are additional resources identified by their original uniform resource locators (URLs) and encoded in base64 binary-to-text encoding. MHTML was proposed as an open standard, then circulated in a revised edition in 1999 as RFC 2557.
The .mhtml (Web archive) and .eml (email) filename extensions are interchangeable: either filename extension can be changed from one to the other. An .eml message can be sent by e-mail, and it can be displayed by an email client. An email message can be saved using a .mhtml or .mht filename extension and then opened for display in a web browser or for editing other programs, including word processors and text editors.[a]
This section relies too much on references to primary sources. (August 2011) (Learn how and when to remove this template message)
Some browsers support the MHTML format, either directly or through third-party extensions, but the process for saving a web page along with its resources as an MHTML file is not standardized. Due to this, a web page saved as an MHTML file using one browser may render differently on another.
As of version 5.0, IE was the first browser to support reading and saving web pages and external resources to a single MHTML file.
Support for saving web pages as MHTML files was made available in the Opera 9.0 web browser. From Opera 9.50 through the rest of the Presto-based Opera product line (currently at Opera 12.16 as of 19 July 2013), the default format for saving pages is MHTML. The initial release of the new Webkit/Blink-based Opera (Opera 15) did not support MHTML, but subsequent releases (Opera 16 onwards) do.
MHTML can be enabled by typing "opera://flags#save-page-as-mhtml" at the address bar.
Creating MHTML files in Google Chrome used to be supported by toggling the experimental "Save Page as MHTML" option by visiting the link "chrome://flags/#save-page-as-mhtml" since version 25.0 (which has been removed since version 75.0) and an API for browser extension since version 35.0.. One now needs to add the "
--save-page-as-mhtml" parameter after Chrome.exe in the Properties panel of the Chrome shortcut or when launching it from a command line/terminal.
It supports both reading and writing MHTML files by toggling the "vivaldi://flags/#save-page-as-mhtml" option.
Mozilla Firefox does not support MHTML. Until the advent of version 57 ("Firefox Quantum"), MHT files could be read and written by installing a browser extension, such as Mozilla Archive Format or UnMHT.
From version 3.1.1 onwards, Apple Inc.'s Safari web browser still does not natively support the MHTML format. Instead, Safari supports the webarchive format, and the macOS version includes a print-to-PDF feature.
As with most other modern web browsers, support for MHTML files can be added to Safari via various third-party extensions.
MIME type for MHTML is not well agreed upon. Used MIME types include:
Problem Steps RecorderEdit
Problem Steps Recorder for Windows can save its output to MHT format.
Save to Google Drive extensionEdit
The "Save to Google Drive" extension for Google Chrome can save as MHTML as one of its outputs.
Microsoft OneNote, starting with OneNote 2010, emails individual pages as .mht files.
Evernote for Windows can export notes as MHT format, as an alternative to HTML or its own native .enex format.
In May 2015, a researcher noted that attackers could build malicious documents by creating an MHT file, appending an MSO object at the end (MSO is a file format used by the Microsoft Outlook e-mail application), and renaming the resulting file with a .doc extension. The delivery method would be by spam emails.
In April 2019, a security researcher published details about an XML eXternal Entity (XXE) vulnerability that could be exploited when a user opens an MHT file. Since the Windows operating system is set to automatically open all MHT files, by default, in Internet Explorer, the exploit could be triggered when a user double-clicked on a file that they received via email, instant messaging, or another vector, including a different browser.
- Because MHTML files contain all page information in a single file, including multimedia contents, these files are significantly larger than plain HTML files, which store multimedia contents in separate files. Earlier text editors and lower-end systems might struggle to handle larger MHTML files. Searching for text strings through a higher number of MHTML files using utilities such as
grepdoes also require more time.
- Holden, Amanda. "Difference of HTML & MHTML". Archived from the original on 17 November 2017. Retrieved 17 November 2017.
- Santambrogio, Claudio (10 March 2006). "…and one more weekly!". Opera Software. Archived from the original on 15 January 2010. Retrieved 2009-05-15.
- "chrome.pageCapture". developer.chrome.com. Retrieved 2019-11-10.
- février 6, Publié sur; Tetzchner, 2019-Par Jon von (2019-02-06). "Vivaldi Update | Auto-Stacking Tabs". Vivaldi (in French). Retrieved 2019-05-16.
- "Bug 40873 - Save as rfc 2557 MHTML; complete webpage in one file".
- Kovacs, Eduard (May 11, 2015). "Attackers Hide Malicious Macros in MHTML Documents". SecurityWeek.Com. Retrieved April 19, 2019.
- Mosuela, Lordian (July 10, 2015). "New Tricks of Macro Malware". Cyren. Retrieved April 19, 2019.
- Cimpanu, Catalin (April 12, 2019). "Internet Explorer zero-day lets hackers steal files from Windows PCs". ZDNet. Retrieved April 19, 2019.
- MHTML standard explained
- RFC 2557 (1999)—MIME Encapsulation of Aggregate Documents, such as HTML (MHTML)
- RFC 2110 (1997, Obsolete)—MIME E-mail Encapsulation of Aggregate Documents, such as HTML (MHTML)
- Free MHT Viewer—A Free application to view MHTML files in batch on Windows
- MHT-rip—A program to view MHTML files on Linux