HTML to PDF

Convert an HTML file or pasted HTML code to PDF with your browser’s own engine. Choose paper, orientation and margins. Free, private, no uploads.

Processed on your device. Files are never uploaded.

Choose an HTML file first.

How to convert HTML to PDF

  1. 1Choose an HTML file, or switch to “Paste HTML code” and paste your code.
  2. 2Pick the paper, orientation and margins. The preview updates as you go.
  3. 3Click “Save as PDF” and choose “Save as PDF” as the printer in the print window.

About this tool

HTML is a handy way to produce invoices, reports, newsletters and documentation, but people usually want a PDF to send or archive. This tool shows your HTML exactly as a browser does and saves it as a PDF with real, selectable text.

Styles in the page are kept, including colors and backgrounds, and you can choose the paper size, orientation and margins. CSS print rules such as page breaks (break-before, break-after) work too.

For privacy and safety, scripts in the HTML don’t run and nothing is loaded from other websites. Pictures and styles have to be inside the HTML itself (for example as data URLs or a <style> block).

Frequently asked questions

Can I convert a web page by its address (URL)?

Not with this tool: fetching other websites would mean sending requests from our side. Open the page in your browser and use its own print window (Ctrl+P or ⌘P) with “Save as PDF”, or save the page as an HTML file and convert that here.

Why are some pictures missing?

Pictures that link to a website or to another file on your computer can’t be loaded here, so that nothing is fetched from elsewhere. Pictures embedded in the HTML (as data: URLs or inline SVG) are included.

Does JavaScript run?

No. Scripts are removed before the preview, so only what the HTML and CSS describe is shown. Pages that build their content with JavaScript will look empty or incomplete.

How do I add page breaks?

Use CSS: break-before: page; (or the older page-break-before: always;) on the element that should start a new page. You can also add an @page rule to set your own page size and margins.

Are my files uploaded anywhere?

No. Your files are processed right here in your browser, on your own device. They are never uploaded to our server or anywhere else, so nobody but you can see them. You can even disconnect from the internet after the page loads and the tool keeps working.

Is it really free?

Yes. There are no paid plans, no watermarks on your results, no sign-ups and no daily limits. Because the work happens on your device, the service costs very little to run. It is supported by voluntary donations.

Related tools

Did this save you some time?

PDF Putty is free, with no ads, no sign-up and no limits. A small donation, once or monthly, helps cover hosting and new tools.