HTML to PDF Converter - Headless Chrome | MiConvert

HTML to PDF Converter

Upload a single .html file and we print it with headless Chrome on our servers, pulling in any stylesheets, images and web fonts that are linked by absolute https URL. There is no URL box: whatever your file references with a relative path will not load, so inline those assets before uploading.

📁

Drop your file here

or click to browse

Select File

Max 10 files, 50MB each

SSL Encrypted Auto-deleted No Sign Up 100% Free
HTML → PDF

What happens to your HTML

HTML is written for a screen that can scroll forever and re-flow at any width. A PDF is the opposite: a fixed snapshot you can email, archive, sign or print. That is why people convert invoices, order confirmations, generated reports, email templates and saved articles, where the markup is already final and only the paper version is missing.

The file is first sanitized with DOMPurify, which strips object, embed and applet elements along with inline event-handler attributes. Then every http or https stylesheet, image, font and script on a public host is fetched and inlined into the document, with a 20 MB ceiling per resource and 30 seconds per fetch. Once inlining finishes, all further network access is blocked, the page is loaded at a 1280 by 900 viewport, and Chrome prints it.

Screen CSS is what gets printed, not print CSS, so a @media print block is ignored and the PDF looks like the page looked in a browser window. Text stays selectable, fonts are embedded as subsets, and external hyperlinks remain clickable. What is lost is anything the browser was supposed to build at runtime: in our testing, output written by an inline script did not appear, so tables, charts or dates produced by JavaScript will be missing.

Page geometry is decided by length and cannot be chosen. Content shorter than roughly fifteen Letter pages is printed as one single page as tall as the content, with no margins. Longer content is paginated as US Letter with half-inch margins. A CSS @page size rule is ignored, so asking for A4 in the stylesheet changes nothing. One consequence to plan around: in the single-page mode only the material before the first CSS page break is printed, so a short document that uses page-break-before or break-before loses everything after it.

This suits developers checking a print template, anyone who needs a receipt or a generated report as a document, and people archiving a page they have already saved as a self-contained file.

How to convert HTML to PDF

  1. Save the page as one .html file. The .htm extension is refused at upload, so rename it to .html before you start, and note that a Save page as complete folder of separate assets will not work here.
  2. Make every asset reachable: absolute https links on a public host, or inline the CSS, images and fonts as data URIs. Relative references like img/logo.png or local file paths cannot resolve, because the upload is a lone file in a temporary directory.
  3. Check whether anything important is drawn by JavaScript. If so, copy the rendered markup out of your browser's inspector and upload that instead.
  4. Upload the file, or up to 10 files in one request on guest and free accounts, with each one producing its own PDF. Guests are limited to 50 MB per file.
  5. Run the conversion. Most pages on this tool finish in a few seconds; very heavy documents are cut off at a 120-second render limit and 150 MB of inlined HTML.
  6. Download the PDF within about four hours and check the pagination, especially if your markup contains explicit page breaks.

Converter details

  • Printed by headless Chrome, so modern HTML5 and CSS3 layout, flexbox and grid included, renders the way a browser shows it
  • Remote stylesheets, images and web fonts linked by absolute URL are downloaded and embedded before printing
  • Markup is sanitized and the network is sealed off once inlining is done, so the print step cannot call out anywhere
  • External hyperlinks stay clickable and text stays selectable, with font subsets embedded in the PDF
  • Handles documents up to about 150 MB after inlining and up to two million tags
  • Converts several HTML files in one request, one PDF per file

Video Tutorial

Watch this step-by-step tutorial to learn how to convert HTML files to PDF format online for free using MiConvert.com. No software installation required.

HTML to PDF questions

Can I paste a web page URL?

No. This tool converts a file you upload, so there is no URL or website field. If you want to capture a live page, save it in your browser first, keep it as a single .html file, and make sure the assets it needs are absolute https links before uploading.

Do external stylesheets and images load?

Yes, when they are absolute http or https URLs on a public host. Each one is fetched, capped at 20 MB, allowed 30 seconds, and embedded into the document. Addresses on private or local networks are not fetched, and relative paths such as ./style.css cannot resolve, so they come out unstyled or as broken images.

Does JavaScript run?

Do not count on it. Network access is cut before printing, and in testing content written by an inline script never reached the PDF. Anything generated at runtime, including charts, templating output and lazy-loaded images, should be baked into the markup before you upload.

Can I choose A4, margins or page breaks?

No. Short documents print as a single page as tall as the content with no margins, and long documents print as US Letter with half-inch margins. A @page rule in your CSS is ignored. If you need A4, re-paginate the finished PDF with a page-setup tool.

I used page-break-before and half my document is gone. Why?

That is the single-page mode: for short content only the part before the first break is printed. There is no option to switch modes today. A practical workaround is to split the document into one .html file per section and convert them as a batch, then merge the PDFs.

Why does the PDF not match my print stylesheet?

Because the page is rendered with screen styles. A @media print block, including its hidden navigation and link-URL tricks, has no effect. If you want the print design, move those rules into the regular stylesheet or into an inline style block before converting.

The conversion timed out or failed. What now?

Retry. The failures we see on this pair are a renderer that did not start inside its 30-second launch window and an occasional crash during printing, both of which usually clear on a second attempt. Persistent failures point to a very large or very complex document: trim unused markup, shrink huge embedded images, or split the file.

Is my file private, and how long do you keep it?

Conversion happens on our servers over HTTPS, not in your browser. The uploaded HTML is deleted the moment the job ends, and the PDF remains downloadable through an unguessable link for about four hours, after which it is deleted automatically. File names, sizes and outcomes are logged, and signed-in accounts keep a conversion history entry.