1. Home
  2. PDF Tools
  3. HTML to PDF Converter

HTML to PDF Converter

Paste HTML (with its CSS) or open an .html file and convert it into a paginated PDF document. Useful for invoices, receipts, reports, certificates and email templates.

Drop an .html file here or click to openOr paste HTML code in the box below

Runs locally in your browser. Your files and data are never uploaded or stored.

About the HTML to PDF Converter

Developers, freelancers and small businesses often have documents as HTML: an invoice template, a receipt, a report generated by a script, an email newsletter or a certificate. The HTML to PDF Converter turns that HTML into a paginated PDF you can send, archive or print.

Paste your HTML code or open an .html file. Inline styles and <style> blocks are applied, so your colours, fonts, tables, flexbox and grid layouts look as they do in a browser. Choose A4, Letter, Legal, A5 or A3, portrait or landscape, and the page margins. Long documents are split into pages between lines, table rows and pictures, never through the middle of a line of text.

Use Create PDF for an instant download, or Print / Save as PDF to let your browser's own print engine create a PDF with selectable text. For safety, scripts, iframes and external stylesheets are removed before converting; pictures from other websites are included when those sites allow it, and pictures embedded as data URIs always work.

The HTML is rendered locally in your browser and is never uploaded.

Tips for invoices, receipts and certificates

Write HTML that prints well

  • Put the CSS in a <style> block or in inline styles. External stylesheets from other websites may not load.
  • Use images as data URIs or from addresses that allow loading from other sites. If an image is blocked, it is left out of the PDF.
  • Need exact page breaks? Add style="break-before: page" to the element that should start a new page, for example each invoice in a batch, and use Print / Save as PDF, which follows these rules in your browser.
  • Avoid fixed pixel widths wider than the page. Use width: 100% for tables so they fit A4 or Letter.

A small invoice example

<style>body{font-family:Arial} td{padding:6px;border-bottom:1px solid #ddd}</style>
<h1>Invoice #1042</h1>
<table style="width:100%"><tr><td>Logo design</td><td>$250</td></tr></table>

Scripts on the page are not run, so content that JavaScript would build later does not appear. To save a live web page, open it in your browser and use the browser's own Print → Save as PDF.

How to use the HTML to PDF Converter

  1. Paste your HTML code or drop an .html file.
  2. Choose page size, orientation and margins.
  3. Click "Create PDF" to download it.
  4. For selectable text, click "Print / Save as PDF" and choose Save as PDF.

Frequently asked questions

Can I convert a web page by its URL?

Browsers do not allow one website to read another website's pages, so paste the HTML code instead. In most browsers you can also open the page and use Print → Save as PDF.

Is JavaScript executed?

No. Scripts are removed for safety, so content that is created by JavaScript will not appear. Paste the final HTML instead.

Why is an image missing?

Images from other websites can only be included when that website allows it. Embed the image as a data URI or host it on the same site to be sure it appears.