01 / Pictures
Full addresses load
Pictures with full web addresses load as usual. For pictures saved next to the file, drop them in with it.
Free tool
Paste HTML or open an .html file, such as an email template, an invoice, a report or a page you saved, and save it as a PDF. Your own browser draws it, so styles, web fonts and colours come out the way they look on screen, and the text stays selectable. Choose the paper size and margins, add page numbers or a header, and drop in the pictures that go with the file. A page wider than the paper is shrunk to fit.
Need a custom tool, app or website? Contact us →A print window opens. Choose "Save as PDF" as the destination, then Save.
Paper
Only for HTML you trust. Scripts are off so that code from elsewhere cannot run on this page.
Page numbers and the header are printed by Chrome and Edge. In other browsers, turn on headers and footers in the print window instead. Your settings are kept for next time, except scripts, which start off.
The HTML is shown and printed by your browser. It is never uploaded.
Tips
01 / Pictures
Pictures with full web addresses load as usual. For pictures saved next to the file, drop them in with it.
02 / Breaks
Add style="break-before: page" to any element to start a new page there.
03 / Print styles
Rules inside @media print in your CSS apply to the PDF only, for example to hide a menu or buttons.
Guide
To convert HTML to PDF, you have a browser draw the page at paper size and save it through its print engine as a PDF. This tool does that for HTML you paste or an .html file you open: it shows the page in a preview at the paper's width, adds the page size and margins you pick, then opens your browser's print window so you can save it. Because your own browser draws it, your CSS, web fonts and colours come out as they look on screen, and the text stays real text you can select.
.html file on the area below it. Click Example to try it with a sample invoice.In Chrome and Edge, the destination menu is at the top of the print window. In Safari, open the PDF menu at the bottom of the print window and choose Save as PDF. In Firefox, the destination is called Save to PDF. The name the browser suggests for the file comes from the <title> of your HTML, or from the file name when there is no title.
The page is laid out at the width of the paper less the margins, the same width the PDF will have. CSS counts 96 pixels to the inch, which is 25.4 mm, so you can work out the width your design gets:
| Paper and margins | Width for your content | In CSS pixels |
|---|---|---|
| A4 portrait, Normal (15 mm) | 210 minus 30 = 180 mm | about 680 px |
| US Letter portrait, Normal | 215.9 minus 30 = 185.9 mm | about 703 px |
| A4 portrait, None | 210 mm | about 794 px |
| A4 landscape, Normal | 297 minus 30 = 267 mm | about 1,009 px |
| A3 landscape, Normal | 420 minus 30 = 390 mm | about 1,474 px |
The sum for the first row: 180 divided by 25.4 is 7.09 inches, and 7.09 times 96 is about 680. If your page was designed for a desktop screen, say 1,200 pixels wide, its media queries may switch it to a narrower layout at 680. That is often what you want on paper. If not, pick Landscape or A3, or set Margins to None to win back the space.
Some pages have a fixed width that is wider than the paper, such as a wide table or a layout set to 1,200 pixels. With Shrink a wide page to fit the paper ticked, the whole page is scaled down until it fits, and the message says by how much. Untick it to keep the size, in which case the right side is cut off.
Page numbers (1 / 12 or Page 1 of 12) go at the foot of every page, and a header line at the top. Both sit in the page margin, so the margin is made at least 10 mm when either is on. They use CSS page margin boxes, which Chrome and Edge print; other browsers leave them out, and there you can turn on Headers and footers in the print window instead. When you use these, turn the print window's own Headers and footers off, or you get both.
style="break-before: page" to a heading or a section to begin it at the top of a fresh page.@media print { } in your CSS. They apply only to the PDF, so you can hide a menu, buttons or a cookie bar with display: none.break-inside: avoid to pictures, tables, code blocks and quotes, and keeps headings with the text below them. A table taller than one page still has to split.mm, cm or pt come out at that size on paper, which helps for labels, tickets and letterheads.| In your HTML | In the PDF |
|---|---|
| CSS in a style tag or inline | Kept |
| A stylesheet saved as a separate file | Kept if you drop it in with the HTML file |
| Pictures with a full web address | Load as usual |
| Pictures saved next to the file | Kept if you drop them in with it |
| Web fonts from a font service | Load as usual when you are online |
| Links | Usually stay clickable, depending on the browser |
| JavaScript | Off, unless you tick Run the page's scripts |
Scripts are off by default because pasted code could come from anywhere. Tick Run the page's scripts only for HTML you wrote or trust, such as a report that draws its charts with JavaScript.
Writing in Markdown instead? Markdown to PDF makes the file directly with no print window. For a plain letter or notes, use text to PDF, and shrink a heavy result with compress PDF.
Questions
Not here. Web pages on other sites cannot be read from this page without a server in between, and this tool has none. Open the site in your browser and use File, Print, Save as PDF, or save the page as HTML and drop it here.
Browsers leave out backgrounds when printing unless told otherwise. "Keep background colours and pictures" tells them to keep them; if they are still missing, tick "Background graphics" under More settings in the print window.
Yes. The browser writes the text as text with its fonts, the same as printing any web page to PDF.
Some browsers block printing from inside a frame or a pop-up blocker steps in. Allow pop-ups for this site, or save the HTML as a file, open it in a browser tab and print it from there.
Yes, use Markdown to PDF, which makes the PDF directly without a print window.
Drop the file on this page and click Save as PDF. Your browser's own print window saves it, so there is nothing to install and no account.
Keep Do not split pictures and tables across pages ticked. Anything shorter than a page then moves whole to the next page. For a manual break, add break-before: page to the element.
Yes. Paste the template's code, check the preview, and save. Email templates often use tables and inline styles, which come out as they look in the preview.
Yes. Pick 1 / 12 or Page 1 of 12 under Page numbers. Chrome and Edge print them at the foot of each page. You can also add a short header line, such as a title or a date.
Something on the page runs a little past the end of the last sheet, often a bottom margin or padding. Reduce the bottom margin or padding of the last element, or set Margins to Narrow.
Yes. Pick A4, US Letter, US Legal, A3 or A5, or let the page set its own size, and choose Portrait or Landscape before you save.