EPEddiesPDF>HTML to PDF
Drop an HTML file here or click to upload
Self-contained HTML files work best
Or drop files anywhere on this page. Files are processed in your browser and never uploaded.

How to convert HTML to PDF

Turn an HTML file, a piece of HTML code or a web page into a PDF. The page is laid out the way a browser shows it, and text in the PDF stays selectable and searchable.

  1. Add your HTML

    With Upload HTML file selected, drop the file onto the page, click the upload button, or pick it from Google Drive. Switch to HTML code to type or paste code, or to Web addresses to load pages from sites that allow it. Each address goes on its own line and becomes its own PDF.

    HTML to PDF with the Upload HTML file, HTML code and Web addresses tabs
  2. Set up the pages

    Open More options in the options bar. Choose a Page size (One long page, A4, A3, A2, Letter or Legal), an Orientation (Auto, Portrait or Landscape) and a Page margin in pixels, inches, centimeters or millimeters.

    Page size, Orientation and Page margin settings for HTML to PDF
  3. Convert and download

    Click Convert to PDF. The results screen shows a preview of the PDF. You can download it, save it to Google Drive, continue with another tool, or delete the files. Several web addresses are downloaded as a ZIP.

    Results screen with a preview of the PDF and the Download button

One long page

One long page is the default page size. It keeps the whole document on a single tall page with no page breaks, which suits receipts, long articles and web page snapshots. A paper size splits the content into pages.

The Page size setting for HTML to PDF

More layout settings

Viewport width sets the browser width used to lay out the page; use 1280 or more for desktop layouts. You can also add a delay of up to 5 seconds before capture, hide cookie notices (on by default), use the print stylesheet, or show the URL and date at the top of each page.

Getting the best result

Self-contained HTML works best, with styles and images embedded in the file. Scripts are not run, and images or stylesheets linked by relative path can't be loaded from an uploaded file.

How HTML is laid out and captured as PDF pages

How wide the page is laid out

HTML has no fixed width. It reflows to fit whatever window it's shown in, so the tool has to pick a window size. With "Viewport width" left on Auto, it uses the printable width of the PDF page: the paper width minus both margins, at 96 CSS pixels per inch. On A4 portrait with the default 48 pixel margin, that's about 698 pixels. On Letter it's 720.

That's narrower than a desktop browser, so a responsive page shows its tablet or phone layout. For dashboards and admin screens, set the width to 1280 or more.

When the content is wider than that window anyway (a fixed-width email template or a wide table), nothing is cut off. With Orientation on Auto, the page switches to landscape first, which gives about 1,026 pixels on A4. Anything wider still is laid out at its own width, up to 2,400 pixels, and scaled down to fit. A 1,400 pixel table on A4 comes out at roughly 73% of its size.

Why the result depends on your device

Each page is captured as a picture, then an invisible text layer is laid over it. The picture is taken at 1.5 times normal resolution on a standard monitor and 2 times on a high-density screen, which includes most phones and many laptops. So the same HTML converted on a phone gives a sharper and somewhat larger PDF than on an older desktop monitor.

Each slice is saved as PNG, which keeps text edges clean and white paper pure white. A slice that's mostly photos switches to JPEG at 92% quality when that's less than half the size of the PNG. If the PDF is too big for where it's going, Compress PDF re-encodes those images.

Very long pages

"One long page" has a ceiling. The PDF format allows a page side of at most 14,400 points, which is 200 inches. Content taller than that continues on a second page, cut at a spot where no line of text, image or table row is split. At the default width and margin, that limit is around 19,000 CSS pixels of content. A long chat export or a forum thread with hundreds of replies can reach it.

When something is missing from the PDF

  1. A picture is blank. The tool waits up to 8 seconds for images and 5 seconds for web fonts, then captures anyway. A font that hasn't arrived is replaced by a fallback. Add a few seconds with "Delay before conversion" for image-heavy pages.
  2. A section has vanished. The cookie option removes elements whose id, class or label contains words like cookie, consent or gdpr. It never removes main or article elements, or anything with more than 4,000 characters of text, but on a baking blog a box called "cookie-recipes" can still go. Untick "Automatically hide cookie notices" and convert again.
  3. Tabs, accordions and dropdown menus are closed. Without scripts nothing can open them, so they're captured as they first appear. If it's your own HTML, remove the CSS that hides them before converting.

The page size and margins always come from the tool's settings, so CSS @page rules in your stylesheet have no effect.

Read the full guide

Features

  • Converts an HTML file, pasted HTML code, or a web page from a site that allows it.
  • The HTML is processed in your browser. It is not uploaded to a server.
  • The page is laid out as a browser shows it, and text in the PDF stays selectable and searchable.
  • Use it to archive web pages, save email templates, or turn HTML reports into PDFs.
  • Free to use. Nothing to install and no account needed.

Frequently asked questions

Is there a file size limit?

There is no fixed limit. The file is processed in your browser, so the practical limit is your device's memory.

Does it work on phones and tablets?

Yes. It works in any modern browser, including on phones and tablets.

Are my confidential documents safe?

The file never leaves your device. It is converted in your browser and nothing is uploaded to a server.