What is the MHT file format?
The .mht file extension is used to store a web page archive saved as a MHTML document (short for MIME HTML). Such a file contains HTML markup, images, CSS stylesheets, scripts, and other page elements in the form of a single self-contained file.
Creation of an .mht file
An .mht web page archive is generated by web browsers - including Microsoft Edge and Google Chrome - when the user chooses to save a page as a single-file archive. During this process, all relative HTML hyperlinks are mapped to their embedded sources. That way, not only the page markup but also all multimedia and resource data can be contained in the combined file. Absolute hyperlinks remain unchanged in the process of archive creation.
.mht file advantages
An .mht archive offers the benefit of storing a web page in a single file, which is especially useful if the page references other files stored on the server. An archived web page file allows users to access the website offline. A single-file archive also facilitates moving website content from one place to another.
Additional information
- Contents of an
.mhtfile are encoded using MIME multipart encoding (Base64 or quoted-printable), the same container format used by.emlemail files. - The extension
.mhtmlis an alias for the same format and may be used interchangeably. .mhtfiles can be opened in a plain-text editor to inspect the raw MIME headers and encoded parts..mhtfiles are sometimes used as a vehicle for malware distribution and should therefore be scanned for malicious code before opening files from untrusted sources.
Security & safety
RISK: MEDIUMAn .mht can embed whatever the original page contained, including JavaScript, which may run when the archive is opened in a browser - so treat an .mht from an untrusted source like an untrusted web page (don't open unexpected ones; converting to PDF strips active scripting for safe viewing). Because MHTML shares the MIME container with email, malformed or maliciously crafted .mht files have historically been used in phishing/XSS proof-of-concepts. The file itself can't execute on its own, but be cautious with links and scripts inside, and prefer opening unknown archives in a sandboxed/up-to-date browser or as PDF.
Format details
in a nutshellPrograms that open MHT files
Technical details
deep spec| Format type | Single-file web-page archive using a MIME multipart/related container |
| MIME type | multipart/related (primary); message/rfc822 (alternate) |
| Part encoding | Each embedded resource encoded as Base64 or quoted-printable within its MIME part |
| File signature | No binary magic bytes; starts with plain-text MIME headers such as "MIME-Version: 1.0" and "Content-Type: multipart/related; boundary=..." |
| Extension alias | .mhtml - identical format, used interchangeably across browsers and applications |
| Resource types embedded | HTML markup, CSS stylesheets, images (JPEG, PNG, GIF), JavaScript files, and web fonts |
| Hyperlink remapping | Relative URLs replaced by content-ID references (cid:) pointing to embedded MIME parts |
| Absolute links | Preserved unchanged during archive creation; only relative links are remapped to embedded content |
| Container family | Shares the same MIME multipart structure as .eml email files (RFC 2822); some email clients can open .mht files |
| Browser support | Natively supported by Internet Explorer, Microsoft Edge, and Google Chrome; Firefox requires an add-on such as UnMHT |
| Offline access | Entire page - markup and all resources - loads without a network connection once saved |
| Text editor viewable | Yes; MIME headers and Base64/quoted-printable content parts are fully readable as plain text |
| Snapshot behavior | Captures the page exactly as it appeared at save time; dynamic or live-updated content is not refreshed on subsequent opens |
| Active content risk | Can embed JavaScript and other executable content; files from untrusted sources should be scanned before opening |
| Office application support | Microsoft Word can open and save .mht/.mhtml files as an alternative to native .doc/.docx formats |
| Released | RFC 2557 (1999); .mht popularized by Internet Explorer 5 (1999) |
| Open standard | Yes · royalty-free |
| Specification | www.rfc-editor.org |
MHT conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about MHT files.