Free tool

HTML to PDF.

Paste HTML or drop an .html file, choose the page size and margins, and save it as a PDF — backgrounds, fonts and JavaScript charts included. Your browser does the conversion, so nothing is uploaded.

index.html
1.9 KBStays in your browser — nothing uploads.
PDF options
A4 portrait · 703px content width

In the print dialog, set the destination to Save as PDF. The preview shows the page at its printed width; page breaks appear in the dialog.

Sending this to people? A link beats a PDF.

Charts stay interactive, it reads on a phone, fixes don’t mean re-sending a file, and readers comment on the exact line. Free, no card.

What the converter does

  • Sets the paper with a CSS @page rule — A4, Letter, Legal, A3 or A5, portrait or landscape, with no, narrow, normal or wide margins — so the print dialog opens already configured.
  • Keeps background colors and images with print-color-adjust: exact, which browsers otherwise strip when printing.
  • Stops table rows, images, SVG and canvas charts, figures and code blocks from being sliced across a page break, and keeps headings with the text below them.
  • Hides anything matching a selector you give it — navigation, buttons, cookie banners, a .no-print class — only in the PDF.
  • Runs the page’s scripts in a sandboxed frame first, so JavaScript-rendered charts and tables are in the PDF, not blank boxes.

Why the PDF looks different from the page

A PDF page is narrower than most screens — A4 with normal margins leaves about 700 pixels — so wide dashboards hit their mobile breakpoint or overflow off the right edge. Switch to landscape or narrow margins first; the preview above is drawn at the printed width so you can see the effect before you print. If images or styles are missing, the HTML points at files next to it that a pasted copy doesn’t have; inline them with the image to Base64 tool, or see why an HTML report loses its CSS.

Questions

How do I convert HTML to PDF?
Paste the HTML or drop an .html file on this page, pick the page size, orientation and margins, and click “Save as PDF”. Your browser's print dialog opens on the rendered page; choose “Save as PDF” as the destination (in Chrome and Edge it is the default printer option) and save.
Is my file uploaded to a server?
No. Most online HTML to PDF converters send your file to a server that runs a headless browser. This one renders the page in a sandboxed frame in your tab and uses your own browser's PDF engine, so the HTML never leaves your machine.
Why are background colors missing from my PDF?
Browsers drop background colors and images when printing to save ink. Keep “Print backgrounds” on — it adds print-color-adjust: exact to the page — and if the dialog still strips them, tick “Background graphics” under More settings in the print dialog.
How do I stop tables and charts being cut in half across pages?
Leave “Keep tables and charts together” on. It adds break-inside: avoid to table rows, images, SVG and canvas charts, figures and code blocks, and keeps headings with the paragraph after them. A single element taller than a page will still split — nothing can avoid that.
Do JavaScript charts show up in the PDF?
Yes. The page runs with scripts, so Chart.js, Plotly, D3 and similar charts render before you print. Wait for animations to finish before clicking Save as PDF. Charts that load data with fetch() from files next to the HTML won't have anything to fetch from a pasted copy.
Should I send a PDF or a link?
A PDF is right for an archive, a contract or a printout. For a report people need to read and discuss, a link is usually better: interactive charts stay interactive, it reflows on a phone, a fix doesn't mean re-sending a file, and readers can comment on the exact line. “Get a shareable link” turns the same HTML into a Comma report.

Related: HTML viewer · Markdown to HTML · HTML formatter · CSV to HTML table · all free tools · email an HTML report · HTML file too big to email · stop screenshotting reports