HTML to PDF

Paste HTML, choose a page size, and export as PDF. Uses your browser's print-to-PDF — fully private, no uploads.

HTML Input
Preview

Tip: in the print dialog, choose "Save as PDF" as the destination. Headers/footers and "Background graphics" can be toggled there too.

Print-ready PDFs from any HTML

Whether you're producing invoices, certificates, contracts, tickets, or simply a print-ready version of a web page, our HTML to PDF converter uses your browser's native print engine to generate a crisp, vector-quality PDF — no servers, no uploads, no watermarks. The result is identical to what you'd get from File > Print > Save as PDF, but driven by a clean preview you control.

How the converter works

The tool wraps your HTML in a clean print stylesheet, applies the page size, orientation, and margins you choose, then opens the browser's print dialog targeted at Save as PDF. Because the rendering happens locally, you can use any web font, embed images, render SVG charts, and apply gradients — they all carry over perfectly into the PDF.

Common use cases

  • Invoices & receipts. Generate dynamic, branded PDFs from order data.
  • Certificates & tickets. Issue downloadable, printable proof of completion or attendance.
  • Reports & statements. Turn an HTML dashboard into a paginated, printable document.
  • Resumes & portfolios. Maintain a single HTML source of truth and export to PDF for applications.
  • Manuals & eBooks. Use HTML for source, PDF for distribution.

CSS tips for print

Print-friendly CSS uses @page for margins, page-break-before / page-break-afterfor forced breaks, and page-break-inside: avoid to keep headings with their following content. Specify font sizes in pt instead of rem for consistent print sizing. Hide UI elements like nav bars with @media print { .nav { display: none; } }. Save dark backgrounds for screens — they look messy in print and burn ink.

Browser-based vs server-based

Server-based PDF generators like Puppeteer or wkhtmltopdf give you the same fidelity, but they require infrastructure, cost money to run at scale, and send your data to a server. For most cases — invoices, certificates, one-off reports — the browser is the simplest, fastest, and most private option.

Page size, orientation, and margins

The converter ships with the four sizes you'll actually use: A4 (most of the world),Letter (US/Canada), Legal (long contracts), and A5 (booklets and half-page handouts). Pair them with portrait or landscape orientation and three margin presets — narrow (0.5in), normal (0.75in), or wide (1in). For pixel-perfect control you can override the underlying@page rule directly inside your HTML, since the converter respects any print CSS you provide. Always preview before saving: a one-character mistake in margins or orientation is much cheaper to spot in the print dialog than after you've emailed the PDF to a client.

Frequently asked questions

Common questions about the html to pdf converter.

Does the output preserve fonts and gradients?
Yes — the converter uses your browser's rendering engine, so any web font, gradient, SVG, or image you can show on screen will appear in the PDF too.
How do I force a page break?
Add a wrapper with style="page-break-before: always;" before the section you want on a new page, or use page-break-after: always; on the previous one.
Why does my PDF look smaller than expected?
Make sure "Background graphics" is enabled in the print dialog so colored backgrounds export, and use pt or in units instead of rem/px for predictable sizing on paper.
Are the converters really free?
Yes. Every converter on Instant CSS is free to use, with no signup, no watermarks, and no usage caps. You can use them for personal and commercial projects.
Do my files get uploaded to a server?
No. Every converter runs entirely in your browser using JavaScript. Your input never leaves your device — that means your data stays private and the tools work offline once the page is loaded.
Which browsers are supported?
All modern browsers — Chrome, Edge, Firefox, Safari, Brave, and Arc. We use standard web APIs (Blob, URL.createObjectURL, Canvas) that have been stable for years.

More converters