SingleFile vs MHTML: Which Format Is Better for Offline Webpages?
SingleFile HTML is the more portable default for offline reading; MHTML fits browser workflows that already support it. Here’s how to choose and save reliable snapshots.
For most people saving one page to read or share offline, choose SingleFile HTML. It is ordinary HTML, can be reopened without the extension, and the SingleFile project documents support across a broad range of browsers. Choose MHTML when the browser or application that will reopen the file already handles MHTML well, or when it fits an existing browser save workflow. This recommendation is an inference from documented compatibility and format differences, not a controlled test. SingleFile project documentation
Neither format guarantees a perfect offline clone of an interactive website. A saved page is a snapshot: scripts, maps, carousels, and other live features may not behave as they did online. If you need a preservation master for professional web archiving, use a suitable WARC-based workflow instead.
What SingleFile and MHTML mean
SingleFile is a project and a set of output formats
SingleFile is a browser extension and command-line tool for saving complete webpages. Its ordinary HTML output combines the page and its resources into one HTML file. The project also offers other output types, including self-extracting ZIP, MHTML, Safari WebArchive, and HTML with a resource folder. Its project documentation lists Chrome, Firefox on desktop and mobile, Microsoft Edge, Safari, Vivaldi, Brave, Waterfox, Yandex Browser, and Opera as compatible browsers. Check the current project documentation and your actual target browser before relying on a particular workflow. SingleFile project and format comparison
MHTML is an aggregate document format
MHTML is a MIME-based format for encapsulating aggregate documents such as HTML and its associated resources. The standard is RFC 2557. It packages a page and related resources in a single file, but its internal structure differs from ordinary HTML.
Watch the naming collision: “SingleFile” can mean the SingleFile project, or it can mean Microsoft’s CoreWebView2SaveAsKind.SingleFile enum value. In the WebView2 API, that enum option saves a page as MHTML; it does not mean that all output from the SingleFile project is MHTML. Microsoft WebView2 save-kind documentation
SingleFile HTML vs MHTML at a glance
| Question | SingleFile HTML | MHTML |
|---|---|---|
| What is it? | Ordinary HTML output from the SingleFile project, with page resources included in the file. | A MIME aggregate document that packages HTML and related resources. |
| Who can open it without an extension? | The project’s comparison says HTML can be viewed without the extension and without running JavaScript. | The project’s comparison describes extension-free viewing as limited to Chromium-based browsers and Internet Explorer. |
| Can you search its text? | The project marks page text as indexable. | The project also marks page text as indexable. |
| Can you extract the resources? | Ordinary HTML output does not have the extraction property listed for the project’s self-extracting ZIP option. | The project likewise does not list ordinary MHTML as directly extractable. |
| Will dynamic features work offline? | Not reliably. Scripts are removed by default in SingleFile because they can alter rendering and are not guaranteed to work offline. | Do not assume interactivity will survive a save. A bundled file is still a snapshot with browser-dependent behavior. |
The format comparison is qualitative; the project does not provide a controlled file-size or speed benchmark. SingleFile project comparison · SingleFile FAQ
Which format should you choose?
Choose SingleFile HTML when portability matters
- You plan to share the file with someone whose browser is unknown.
- You want a standalone HTML file that can be opened without installing the SingleFile extension.
- You want ordinary HTML that is convenient for local reading and text indexing.
Choose MHTML when the destination software supports it
- Your team already saves and reopens MHTML in a Chromium-based browser or a compatible application.
- You use a browser or embedded browser API whose built-in workflow produces MHTML.
- You have tested the file in the exact browser and operating system where it will be read.
Choose another SingleFile output if the archive workflow requires it
If you need to extract page resources later, the project documents a self-extracting ZIP output that can be unzipped. If your workflow requires separate files, it also offers HTML plus a resource folder. These are different output choices from ordinary SingleFile HTML and MHTML. Check the project’s current documentation for the precise options available in your version.
Save a page with SingleFile
- Install the SingleFile extension from the browser’s official extension store, or use the project’s CLI if you need a repeatable command-line workflow. The project documentation lists supported browsers and installation paths: SingleFile project.
- Open the page and wait for the content you need to appear. Scroll through lazy-loaded sections if images or content load only as you scroll.
- Use the extension’s save action and choose the desired output format in its settings. Select regular HTML for the portable default, or MHTML if the target reader requires it.
- Open the saved file offline in the intended browser. Check important images, links, tables, and page sections before sharing it.
SingleFile provides both an extension and a CLI, but command-line flags and extension settings can change. Use the current project documentation for runnable CLI syntax and version-specific configuration rather than copying an unverified command. Official project documentation
Save MHTML with a browser or application
MHTML save commands vary by browser and application. In Chromium-based workflows, use the browser’s available save-page option if it offers MHTML, then reopen the result in the destination browser to confirm compatibility. For applications built on WebView2, Microsoft’s API exposes a save kind named SingleFile that saves as MHTML. Consult the API documentation for the current method and language binding: CoreWebView2SaveAsKind.
There is no universal browser command that produces MHTML in every browser. If your browser does not offer it, use a documented application workflow that supports MHTML and verify the resulting file. Avoid renaming an HTML file to .mhtml; changing the extension does not convert the format.
Check the saved page before relying on it
- Test offline: disconnect from the network or disable network access for the browser, then open the file.
- Inspect critical content: confirm the text, images, and sections needed for the task are present.
- Check dynamic areas: try controls only if you need them; do not assume forms, maps, carousels, or embedded content will work.
- Test the recipient’s environment: open the file in the same browser family and operating system the recipient will use.
- Keep the original URL and capture date: store them alongside the snapshot if you need provenance or context later.
What may be missing or behave differently offline
- Scripts and interactions: SingleFile removes scripts by default because they may alter page rendering and are not guaranteed to work offline. Its FAQ specifically warns that dynamic maps and carousels may not work correctly. Enabling scripts or changing cleanup settings does not guarantee offline functionality. SingleFile FAQ
- Content that had not loaded: pages often load images, comments, or additional content after scrolling or user interaction. Capture only includes content available to the saving workflow.
- Frames and deferred images: SingleFile’s FAQ notes that removing frames or deferred images can leave resources out. Review cleanup and capture settings if these are important.
- Protected domains: browser security can block extensions on some protected pages.
- Images requiring a Referer: some sites require a
Refererheader to retrieve images. SingleFile’s FAQ says that option is off by default for privacy reasons; consider the privacy implications before enabling it. - Cleanup tradeoffs: removing unused styles or hidden elements can reduce output, but cleanup settings can affect processing time or what is retained. Validate the resulting page.
- External content: media players, embedded documents, remote fonts, and third-party widgets may still depend on network services or restrictions imposed by the destination browser.
Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| MHTML opens as raw text or fails to open | The application may not support MHTML, or the file may be malformed or mislabeled. | Open it in a browser known to support the workflow, verify the actual save format, and do not rely on the extension alone. If the recipient’s browser is unknown, save as SingleFile HTML and test it there. |
| An image is missing | It had not loaded at capture time, was deferred, is inside a frame, or requires a Referer. | Load the image on the live page before capture, inspect deferred-image and frame settings, and review the FAQ’s Referer option if appropriate. |
| A map, carousel, or control is frozen | The offline snapshot lacks the scripts, live data, or network services that power the feature. | Treat the saved page as a visual and textual snapshot. Keep a link to the original page for interactive use. |
| The extension cannot save the page | The browser may restrict extensions on a protected domain or page. | Check browser restrictions and the project’s FAQ. If the page cannot be captured through the extension, use an allowed browser or application workflow. |
| The file is unexpectedly large or slow to save | The page may contain many high-resolution images, embedded resources, or content that cleanup must process. | Review the page and cleanup settings, and consider the project’s ZIP or HTML-plus-resource-folder output if your storage workflow supports it. The project does not publish a universal size or speed guarantee. |
| Recipient sees a different layout | Rendering can vary by browser, fonts, viewport, saved styles, or content that loaded differently. | Test in the target browser and compare essential sections. A snapshot is not a pixel-identical rendering contract across environments. |
Performance, reliability, and storage
There is no cited controlled benchmark establishing that SingleFile HTML or MHTML is faster or smaller in general. Output size depends on the page’s content and resources, while save time depends on capture and processing. For an operational archive, measure with representative pages from your own site and compare both formats in the actual reader application.
- For reliability: test a sample in the destination browser, preserve the source URL and date, and retain another copy of important material according to your organization’s backup policy.
- For resource handling: use the project’s self-extracting ZIP output when later extraction is required, or HTML plus a resource folder when you need separate files.
- For search: the project’s comparison marks page text as indexable in both HTML and MHTML, though indexing behavior depends on the local search tool.
- For long-term preservation: neither format should be treated as a professional web-archiving master; use a WARC-based workflow for that purpose. SingleFile FAQ guidance
Or skip the browser setup
If you need a screenshot image or PDF of a page rather than an offline HTML archive, ScreenshotNeo is a website screenshot API and MCP server. Its one-call API returns a screenshot or PDF; see the API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo removes cookie banners, popups, and chat widgets before the shot. Bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Create a free account and get 1,000 screenshots a month with no card.
FAQ
Can I open an MHTML file in Firefox or Safari?
Do not assume so. The SingleFile project describes extension-free MHTML viewing as limited to Chromium-based browsers and Internet Explorer. Test the exact browser version and workflow you intend to use; choose SingleFile HTML when the reader is unknown. Project comparison
Does the word “SingleFile” always mean HTML?
No. It names a project that can produce several formats, and Microsoft WebView2 also uses SingleFile as an enum value for its MHTML save option. Check the context and output file format.
Will saved pages work as interactive offline copies?
Not reliably. Dynamic behavior can depend on scripts, data, and services that are unavailable offline.
Is either format suitable as the preservation master for a web archive?
The SingleFile FAQ says the project is not intended for professional web archiving and points toward WARC-based tools. Use an appropriate archival workflow when preservation requirements demand it. SingleFile FAQ
