ToolGenie

HTML to PDF

Print an HTML file to PDF in your browser.

Loading tool…

How to use HTML to PDF

  1. Upload the HTML file you want to convert.

  2. The tool opens the page locally and launches your browser's print dialog.

  3. Choose "Save as PDF" as the destination.

  4. Save the resulting PDF to your device.

HTML to PDF without installing anything

You have an .html file — an exported report, an email saved from a mail client, an invoice a system generated, a page you built, documentation you want to keep offline — and you need it as a PDF. Converting HTML to PDF used to mean installing a command-line tool or a browser extension. Here you drop the file in, it is rendered locally, and your browser's print dialog produces the PDF.

The result is a real PDF with selectable, searchable text and embedded fonts, produced by the same print engine Chrome, Edge, Firefox and Safari use for Print to PDF — which is, for most HTML, the best renderer there is, because it is a browser rendering a web page.

It also works on any operating system and on a phone or tablet, because the only software involved is the browser you already have. There is no extension to trust, no desktop application to update and no command-line tool to configure.

What renders, what does not, and why

Everything contained in the file renders exactly as it would in a browser tab: text, inline styles, embedded stylesheets, data-URI images and tables. Resources referenced by absolute web URLs — a stylesheet on a CDN, an image on a website — load if you are online. Resources referenced by relative local paths, such as images/logo.png sitting beside the HTML file, cannot load, because a browser has no access to your folder.

So the files that convert best are self-contained: a single .html with its CSS inline and its images embedded. Many export functions produce exactly that; for one that does not, most browsers can save a page as a single file (Webpage, Complete or the MHTML option) and page-bundling tools can inline the assets. If the layout looks right in the preview, it will look right in the PDF.

  • Inline CSS and embedded images always render.
  • Absolute URLs render when you are online.
  • Relative local paths do not — inline those assets first.

Controlling page size, margins and page breaks

The print dialog gives you paper size, orientation, margins, scale and background graphics. Turn on Background graphics if your page uses coloured backgrounds or a styled header and they are missing from the preview; browsers skip them by default to save ink. Turn off Headers and footers to drop the page title, date and file path the browser prints in the margins.

If you control the HTML, print CSS goes a long way: an @media print block to hide navigation, page-break-before on headings that should start a new page, and an @page rule to set margins. For pages you did not write, adjusting the scale in the dialog is usually enough to keep a wide table on one page width.

  • Background graphics: on, if colours and headers are missing.
  • Headers and footers: off, to drop the title, date and path.
  • Scale: lower it to fit wide tables on one page width.

Rendered on your device, never uploaded

Every step runs inside your browser, using the WebAssembly and Canvas APIs your device already ships with. No file is uploaded, no copy is kept, and nothing sits in a queue on a server waiting to be deleted — which is also why the tool keeps working with the network disconnected.

Saved HTML files often contain exactly the things you would not post publicly — order confirmations, account statements, internal reports, private correspondence exported from a mail client. Because the page is rendered in your browser and the PDF is generated by the browser's own print engine, nothing is uploaded, there is no account and no watermark.

Frequently Asked Questions

How is the HTML turned into a PDF?

The tool renders your HTML file locally and opens the browser's built-in print dialog, where you pick "Save as PDF". This uses your browser's own high-quality PDF engine.

Will external images and stylesheets load?

Resources referenced with absolute URLs can load if you are online, but files referenced with relative local paths will not. Self-contained HTML files convert best.

Can I convert a live website URL?

This tool converts HTML files from your device. For a live website, save the page as HTML first, or simply use your browser's Print > Save as PDF on that page.

How is the HTML turned into a PDF?

The tool renders your HTML file locally in an isolated frame and opens the browser's built-in print dialog, where you choose Save as PDF. The PDF is produced by your browser's own engine, with real text and embedded fonts.

Will external images and stylesheets load?

Resources referenced with absolute web URLs load if you are online. Files referenced with relative local paths cannot, so self-contained HTML files with inline CSS and embedded images convert best.

Can I convert a live website URL?

This tool converts HTML files from your device. For a live page, save it as HTML first, or simply use your browser's own Print and Save as PDF on that page.

Why are my background colours missing?

Browsers skip background colours and images when printing by default. In the print dialog, expand More settings and tick Background graphics.

Can I control where pages break?

Yes, if you can edit the HTML: add page-break-before or break-before rules in a print stylesheet. Otherwise, adjust the scale and margins in the print dialog to influence where the browser breaks pages.

Is the HTML file uploaded?

No. The file is rendered in your browser and the PDF is created locally by the browser's print engine. It works offline and requires no sign-up.

Related tools

Looking for something else? Browse all pdf tools.