Convert HTML to PDF — free, in your browser, no signup
Updated
HTML to PDF means different things to different people: print a webpage, convert email markup to PDF, render a styled document. SwissArmyPDF uses the browser's own print engine for lossless rendering — CSS, web fonts, tables, all preserved. Drop HTML or paste it, click Save as PDF.
When you need HTML → PDF
- Email content archive. Save an HTML email as PDF for record-keeping.
- Custom invoice or receipt. Generate HTML from your billing system, render to PDF, attach to email.
- Report generation. Build a styled HTML report (chart libraries, custom CSS), export to PDF.
- Documentation snapshots. Save a doc page at a point in time.
- Editorial proof. Convert draft HTML to PDF for review.
- Static site export. Print specific pages from a static site for offline reading.
How to convert HTML to PDF (step by step)
- Open HTML to PDF.
- Drop an .html file or paste HTML directly into the editor.
- Pick a page size (A4 or Letter).
- Click Save as PDF. Your browser's print dialog opens.
- Choose Save as PDF as the destination.
The print engine renders the HTML with the browser's full CSS support — exactly what you'd see in a browser tab, but paginated.
What CSS works
Because we use the browser's native print engine, you get everything the browser supports:
- Flexbox, Grid, Position. All modern layout primitives.
- Web fonts.
@font-faceworks; fonts load before printing. - Backgrounds and gradients. Browser may have a "background graphics" toggle in the print dialog — enable for full color.
- Print-specific CSS.
@media printrules apply. Usepage-break-before/page-break-afterfor explicit pagination control. - @page rules. Set page size, margins, and headers/footers per CSS spec.
Caveats:
- External resources need HTTPS. Images, fonts, and stylesheets must be HTTPS-reachable; mixed-content blocking will skip HTTP assets.
- JavaScript runs once before print. Heavy SPAs that fetch async data may not finish rendering before the print dialog opens.
- iframe content may not render depending on the source's CORS policy.
Controlling page breaks
By default, the browser paginates wherever it lands. To force breaks:
- Page break before an element:
<div style="page-break-before: always"></div> - Keep an element on one page:
page-break-inside: avoid - Break after:
page-break-after: always
For headers/footers on every page, use the @page CSS at-rule with margin boxes — though browser support varies.
Browser-print vs server-side HTML→PDF (Puppeteer, wkhtmltopdf)
| Approach | Strength | Weakness |
|---|---|---|
| Browser-print (this tool) | Free, no setup, lossless rendering, no upload | Manual click in print dialog; not batchable |
| Puppeteer / Playwright | Scriptable, batchable, headless | Requires Node.js + Chromium install |
| wkhtmltopdf | CLI, batchable, simple deploy | Older WebKit fork; some modern CSS missing |
| weasyprint | Pure CSS-spec compliance for print | Doesn't run JS; CSS subset different from browsers |
For one-off conversions, the browser tool is fastest. For automation (1000 invoices/day), Puppeteer is the right answer.
Troubleshooting
- Popup blocked. Allow popups for swissarmypdf.com.
- Images missing. External images need HTTPS. Local file paths and HTTP-only URLs are blocked.
- Background colors missing. In the print dialog, enable "Background graphics" (Chrome) or "Print backgrounds" (Firefox).
- Layout breaks in print. Some CSS layouts that work on screen break at page boundaries. Use
page-break-inside: avoidon elements you want to keep together. - Web fonts didn't load. The print dialog can fire before async font loads finish. Wait a moment and retry.
Why local HTML-to-PDF matters
HTML files often contain things you don't want online: internal report markup, draft content, email contents, customer data. Web-based converters upload your HTML to a remote server and render it there — your content briefly lives on someone else's disk. SwissArmyPDF uses your browser's own print engine; the HTML is rendered in a popup window in your browser, then your browser saves the PDF. No upload, no remote rendering.
Common next steps
- Markdown to PDF — if your source is markdown, go direct instead of converting MD → HTML → PDF.
- Merge PDF — bundle converted HTML files into one PDF.
- Compress PDF — shrink the output for email.
- Watermark PDF — mark as draft.