HTML to PDF
Paste HTML and CSS, or start from an example, and see it laid out as pages. Then save it as a PDF with real, selectable text.
- 1Add your HTML
- 2Preview your layout
- 3Save as PDF
The preview shows the screen layout. Page size, margins and page breaks apply when you save. Scripts in your HTML never run.
How to convert HTML to PDF
- Paste your HTML, or load one of the examples.
- Choose page size, orientation and margins, and check the preview.
- Press Save as PDF, then pick “Save as PDF” as the printer in the dialog that opens.
Good to know
The PDF is produced by your browser’s built-in print engine, the same one behind “Print → Save as PDF”. That means modern CSS, web fonts, flexbox and grid all work, and text stays vector and selectable.
Control page breaks with break-before: page or break-inside: avoid. Set the page size and margins with an @page rule or the options above.
Building PDFs on a server instead? Our mPDF guides cover the PHP side, and the examples gallery has templates that work in both.
Questions
Is my file uploaded anywhere?
No. PDF1 runs the whole job inside your browser tab with JavaScript and WebAssembly. The page has no upload endpoint, and its security policy blocks connections to other servers, so the file stays on your device. You can even disconnect from the internet once the page has loaded.
Why does a print dialog open?
Browsers only let a page create a PDF through the print dialog. Choose “Save as PDF” (Chrome, Edge) or “PDF” (Safari, Firefox) as the destination. You only do this once per document.
Can I convert a live web page by its URL?
No. Fetching other websites would need a server. Open the page in your browser and use its own Print → Save as PDF, or paste the HTML here.
How do I remove the date and URL from the page edges?
In the print dialog, turn off “Headers and footers” (Chrome and Edge, under More settings).
Do external images and fonts work?
Images and fonts from https URLs load in the preview and appear in the PDF. Scripts in your HTML do not run, for safety.