HTML to PDF

Turn an HTML file or pasted HTML code into a PDF to share or print. Free online HTML to PDF converter, no sign-up, works in your browser.

In short: Turn a web page, a link or an HTML file into a PDF to share or print. Free to use in your browser — no sign-up.

What is HTML to PDF?

HTML to PDF opens your HTML file, code you paste in, or a web page link in a preview exactly as your browser shows it. You then press “Print / Save as PDF” and choose “Save as PDF” in the print dialog — your browser makes the PDF. A link is read by your own browser, and many websites do not let another page read them; when a link will not open, save that page as an .html file in your browser (Ctrl+S) and upload it here instead. It is made for single pages and documents, not for downloading whole websites.

How to use this tool

Watch: How to use HTML to PDF (video)

  1. Open the tool and click “Click to choose an .html file” to upload your .html or .htm file — or paste your HTML into the text box below it.
  2. To use a link instead, paste the web page address into the link box and press “Make PDF from link”. The whole page opens in the preview below. If the link will not open, save the page as an .html file (Ctrl+S in your browser) and upload the file here.
  3. Look through the preview below; it shows the page exactly as your browser sees it. Check the headings, spacing and text.
  4. Press “Print / Save as PDF” to open your browser’s print dialog.
  5. In the print dialog, choose “Save as PDF” as the destination. Pick the paper size, layout and margins, and turn on “Background graphics” if your page has colours you want to keep.
  6. Press Save, then open the saved PDF and check it; if something looks off, fix the HTML and convert again.

About this tool

Developers and students often write simple documents in HTML: a profile page, a resume, a lab report or an invoice template. A PDF is the safer way to hand these over, because the layout will not change on someone else’s screen. This tool shows your saved .html or .htm file, code you paste in, or a web page link in a preview exactly as your browser shows it — then your browser’s print dialog makes the PDF, so no file is ever uploaded.

For a file or pasted code, it works on the content you give it, so it does not need the original web address to be online. For a link, the page must be online, and your own browser reads it. Scripts in the page are not run in the preview. Keep your page self-contained and check the result before sending. If you only need to save text, the PDF to Text and TXT to PDF tools may be quicker.

The link route is honest about its limits. Many websites do not let another page read them directly, so a link that will not open is usually the site saying no, not a fault in the tool. When that happens, save the page in your browser with Ctrl+S and upload the .html file here — that always works, because the file is already on your computer. A link also needs the page to be public: a page behind a login will not open from a link, and some pictures that only load when you scroll may not appear in the preview. What you paste as a link is read straight from your browser to the site, through no server of ours.

The print dialog is where the PDF takes shape. Paper size is usually A4, or Letter in the United States; Portrait suits most documents, while Landscape suits wide tables. Margins and scale shrink a page that is slightly too wide, and the headers and footers switch adds the page address, date and page numbers. Turn on “Background graphics” when your page has coloured headings or shaded table rows you want to keep — browsers leave backgrounds out by default, to save ink.

Be honest about the limits before you send the file. A very complex page — columns, floating shapes, web fonts that are not installed — may shift slightly in print, because the PDF follows the browser’s print layout, not the screen layout. Long content can also split across pages in awkward places: a table row cut in half, or a heading left alone at the bottom of a page. You can fix most of this in the HTML itself with print CSS — break-inside: avoid keeps a block together, break-before: page starts a section on a fresh page, and print-color-adjust: exact keeps colours — then convert again and check the preview.

Nothing here leaves your device, except the page your own browser reads when you paste a link — that read goes straight from your browser to the site, through no server of ours. The file is read in your browser and the PDF is made by your browser. The tool handles one file at a time, and the preview button “Open preview in a new tab” gives you a plain browser tab if you would rather press Ctrl+P there. Once you have the PDF, chain it onward with the Next Action tools — PDF Merge joins several PDFs into one document, and PDF Compress shrinks a PDF that is too big to email.

Example — a student’s HTML resume, ready to send:

A student writes her resume as resume.html: her name and contact details, a short profile, and a table of her marks. She opens it here and checks the preview, then picks A4 and Portrait in the print dialog and turns on “Background graphics” so her coloured section headings print. Before, sending the .html file meant it opened as a web page on the employer’s computer — the layout shifted and her photo was missing, because it lived in a separate file on her own computer. After, she sends one PDF that looks the same on every screen and prints cleanly on a single A4 page.

Her two-page lab report works the same way: about 900 words of HTML become a two-page PDF, small enough to attach to any email. When she first converts it, the marks table splits across the two pages — so she adds break-inside: avoid to the table rows in her HTML, converts again, and the table now stays whole on page two.

Frequently asked questions

How do I turn my HTML file into a PDF with this tool?
Upload your .html or .htm file, or paste your HTML into the text box. Check the preview, press “Print / Save as PDF”, choose “Save as PDF” in the print dialog, and save the file. Your browser makes the PDF — nothing is uploaded.
Can I make a PDF from a web page link?
Yes. Paste the page address into the link box and press “Make PDF from link”. If the site lets your browser read it, the whole page opens in the preview and the same print dialog makes the PDF. If the link will not open, save the page as an .html file (Ctrl+S in your browser) and upload the file here instead.
Why does my link not open?
Many websites do not let another page read them directly, and a page behind a login will not open from a link. Check the link, check your internet, and try again. If it still does not open, save the page on your computer first — in your browser, press Ctrl+S — and upload the .html file here instead.
Does a link send my page to a server?
No. The link is read by your own browser, straight from your browser to the site. Nothing passes through a server of ours, and nothing is uploaded.
Does the PDF keep the page layout?
Yes. The PDF follows the page as your browser shows it. Very complex pages can shift slightly, so check the result before sending.
Why do some images not appear?
Pictures that live in a separate file on your computer may not load in the preview, because the preview only has the code you gave it. Embed the image in the HTML, or use its full web address.
Why are my background colours missing from the PDF?
Browsers leave background colours out of print by default, to save ink. In the print dialog, turn on “Background graphics”. If you write the HTML yourself, you can also add print-color-adjust: exact to your CSS.
How do I stop a table or section splitting across pages?
Add break-inside: avoid to the block in your CSS — for example, tr, .card { break-inside: avoid; }. Use break-before: page to start a new section on a fresh page. Then convert again and check the preview.
Can I paste code instead of uploading a file?
Yes. Paste your HTML into the box and convert it without saving a file first.
Is my HTML uploaded to a server?
No. The document is processed in your browser on your own device.
Can it convert a whole website?
It handles one page at a time. Paste the link of the page you need and press “Make PDF from link” — if the site lets your browser read it, the whole page goes into the PDF. For a whole site, convert page by page, or save each page you need as HTML first (Ctrl+S in your browser) and upload the files here.

Related PDF Tools tools