About the HTML to PDF tool
Invoices, reports, certificates and email templates are often easiest to design in HTML and CSS, but they have to be delivered as PDF. Most online HTML to PDF services upload your code to a server running a headless browser. This one doesn't: it uses the PDF printer that is already built into your own browser, the same engine Chrome, Edge, Firefox and Safari use when you choose "Save as PDF".
Paste a full HTML page or just a fragment, or open an .html file. The page renders live in a sandboxed preview frame that can't access this website or your data. Choose the paper size (A4, Letter, Legal, A3 or A5), orientation and margins; these are applied with a CSS @page rule, and CSS such as break-before: page lets you control where new pages start. When you click "Save as PDF", the preview is sent to your browser's print dialog.
Because the browser prints real text rather than a screenshot, the PDF keeps selectable, searchable text, clickable links and sharp vector graphics. Your page's own JavaScript is blocked by default and can be switched on for pages that build their content with scripts. Nothing is uploaded at any point.
How to use HTML to PDF
- Paste your HTML into the "HTML code" box, or click "Open .html file" ("Sample" loads an example invoice).
- Pick Paper size, Orientation and Margins, and decide whether to print background colours.
- Set the "PDF file name / title"; it becomes the document title and, in many browsers, the suggested file name.
- Check the live preview, then click "Save as PDF".
- In the print dialog choose "Save as PDF" as the destination, turn off "Headers and footers", and save.
Features
Real, selectable text
The browser's own PDF engine keeps text, links and vector graphics instead of flattening a screenshot.
Page size and margins
A4, Letter, Legal, A3 or A5 in portrait or landscape with none, narrow, normal or wide margins.
Full CSS support
Anything your browser supports prints, including flexbox, grid, web fonts and page-break rules.
Sandboxed and private
The preview runs in an isolated frame with scripts off by default; your HTML never leaves the device.
HTML download fallback
Download the prepared page as .html and print it directly if your browser blocks printing from a frame.
When to use it
- Turn an HTML invoice or receipt template into a PDF for a customer.
- Save a coded résumé or portfolio page as a PDF for job applications.
- Produce printable certificates or tickets from an HTML design.
- Archive an HTML email newsletter as a PDF.
- Test how your site's print stylesheet looks on A4 and Letter paper.
Frequently asked questions
Why does this tool open the print dialog?
It uses your browser's built-in PDF printer, which gives the most accurate CSS rendering and real text without uploading anything. Choose "Save as PDF" (or "Microsoft Print to PDF" on Windows) as the printer.
How do I remove the date and URL from the top and bottom of the PDF?
Those are the browser's headers and footers. Untick "Headers and footers" under More settings in the print dialog.
How do I force a page break?
Add a CSS rule such as .page-break { break-before: page; } and place an element with that class where the new page should begin. The sample shows how.
Why are background colours missing?
Browsers skip backgrounds when printing to save ink. Keep "Print background colours" switched on, and if needed tick "Background graphics" in the print dialog.
Can I convert a live website URL?
No. Browsers don't allow one site to load and print another site's pages, so paste the HTML source or open a saved .html file instead. External images and fonts referenced by the HTML are loaded as usual.
Does it work on phones?
On Android Chrome it works through the system print sheet. Some mobile browsers block printing from an embedded frame; in that case use "Download .html" and print the file from the browser.