HTML to PDF Converter
Paste HTML or open a saved web page with its images and stylesheets, see a live preview at the real page width, choose the paper size, margins, header, footer and page numbers, and download the PDF. A second button uses your browser's own PDF engine for files with selectable, searchable text. Nothing is uploaded.
Free · No sign-up
How to use it
- Paste your HTML, or open an .html file together with its images and CSS files.
- Check the preview, then choose the paper size, orientation and margins.
- Add a header, footer or page numbers if you need them.
- Click Download PDF, or Save as PDF with selectable text to use the browser's print dialog.
Why use this tool
Paste code or open files
Open an .html file with its images, fonts and stylesheets in one go; they are linked automatically.
Live preview at page width
The preview uses the real printable width of the paper, so you see where lines wrap before converting.
Page setup
A4, Letter, Legal, A3, A5, JIS B5 or a custom size, portrait or landscape, with preset or custom margins.
Clean page breaks
Cuts move to the gap between lines, and CSS page breaks such as break-before: page are respected.
Headers, footers and numbers
Add text above and below every page and numbering like 2 / 5, in any language.
Private
The conversion runs in your browser. Invoices, contracts and reports never leave your device.
Two ways to turn HTML into a PDF
Download PDF draws every page the way the preview shows it and stores each page as a high-resolution image. The result looks identical in every PDF viewer, keeps web fonts, gradients and SVG charts, and needs no print dialog. The trade-off is that the text can't be selected or searched.
Save as PDF with selectable text gives the page to your browser's print engine with the size, margins and page numbers you chose. Pick Save as PDF (or Microsoft Print to PDF) as the printer. The file keeps real text, working links and smaller file sizes, which is better for contracts, documentation and anything people will search.
| Download PDF | Save as PDF with selectable text | |
|---|---|---|
| Text can be selected and searched | No | Yes |
| Links work | No | Yes |
| Looks exactly like the preview | Yes | Very close |
| File size | Larger | Smaller |
| Works on phones | Yes | Depends on the browser |
Controlling page breaks with CSS
Add break-before: page to an element to start it on a new page, for example each chapter or an attachment. Use break-inside: avoid on tables rows, figures and cards that should never be split. Both methods in this tool understand these rules.
For print-only styles, put them in a @media print block: hide navigation bars and buttons with display: none, and set font sizes in points (pt) for predictable results on paper.
Converting a web page you see in the browser
Browsers don't let one website read another, so the tool can't fetch a URL. Instead, open the page, press Ctrl+S (Cmd+S on a Mac) and choose Webpage, Complete. Then open the saved .html file together with the files in its folder: images and stylesheets are linked automatically.
Pages that build their content with JavaScript may need Run the page's JavaScript turned on. Only do this for code you trust.
Paper sizes
| Size | Millimeters | Inches | Used in |
|---|---|---|---|
| US Letter | 215.9 × 279.4 | 8.5 × 11 | US, Canada, Mexico |
| US Legal | 215.9 × 355.6 | 8.5 × 14 | US legal documents |
| A4 | 210 × 297 | 8.27 × 11.69 | Rest of the world |
| A5 | 148 × 210 | 5.83 × 8.27 | Booklets, notes |
| Tabloid | 279.4 × 431.8 | 11 × 17 | Posters, spreadsheets |
Frequently asked questions
Is the HTML uploaded to a server?
No. The preview, the drawing and the PDF are all made in your browser, so it also works with private documents.
Why can't I select the text in the downloaded PDF?
Download PDF stores each page as an image so it looks exactly like the preview. Use Save as PDF with selectable text and choose Save as PDF in the print dialog to keep real text.
Can I convert a URL to PDF?
Not directly, because browsers block reading other websites. Save the page with Ctrl+S as Webpage, Complete and open the saved file and its folder contents here.
Why are some images missing?
Images from other websites are left out of Download PDF when the site doesn't allow copying. Open the images as files together with the HTML, or use Save as PDF, which prints them normally.
How do I add page numbers?
Tick Page numbers. Download PDF adds them in the bottom corner; with Save as PDF they appear in browsers that support page margin boxes, such as recent Chrome and Edge.
Does it support CSS Grid, Flexbox and web fonts?
Yes. Both methods handle modern layouts. Web fonts load as long as they are linked from the page or opened as files with it.
How to convert HTML to a clean PDF
Related tools
Need something built?
Tell us what you want to create.
Tell us what you need built, from a simple website to a complete app, AI solution, automation, or custom system.