How to Convert HTML to PDF (Files and Saved Web Pages)
Turn an HTML file or a saved web page into a clean, readable PDF with headings, tables, links and pictures, without the menus and adverts. Free, and nothing is uploaded.
By PickyPDF team · · 4 min read
An HTML file is how the web stores a page: text, headings, links and pictures, held together by tags. It's perfect in a browser, but sometimes you need a PDF instead: to keep a copy of an article, to send a page to someone, to print a help page or report, or to file a receipt that came as an HTML email.
This guide shows how to convert HTML to PDF with the free HTML to PDF converter, and how to turn a web page into a PDF when all you have is the page in your browser.
Two ways to turn HTML into a PDF
Printing to PDF from your browser (Ctrl+P, then "Save as PDF") copies the page exactly as it looks on screen. That's the right choice when the design matters. But you also get the site's menus, cookie banners, sidebars and adverts, and text in wide layouts is often cut off at the page edge.
Converting the HTML reads the page's content instead: its headings, paragraphs, lists, tables and pictures. It then lays that out as a clean document, with page numbers, bookmarks for the headings and links you can click. That's the right choice when you want to read the page, print it tidily or keep it as a document. It's what the HTML to PDF converter does.
How to convert an HTML file to PDF
- Open HTML to PDF and choose your .html file, or drop it onto the page. You can also paste HTML code into the box below.
- Wait a moment. The converter reads the page in your browser and works out the title, the author and the main content.
- Check the result. You see the number of pages, words and pictures, and a preview of the PDF.
- Click Download PDF.
Want different settings? Change the page size, the text size or Main content only, then click Apply to this PDF. The PDF is made again without counting another conversion.
How to convert a web page to PDF
The converter works from the page's HTML file, so first save the page from your browser:
- Open the page and press Ctrl+S (Cmd+S on a Mac).
- Choose Webpage, Complete. Your browser saves an .html file and a folder with the page's pictures next to it.
- In HTML to PDF, choose the .html file together with the picture files from that folder (select them all in the file window).
The pictures are matched to the page by their file names, so they appear where they were on the page. If you choose only the .html file, the PDF still has all the text, just without those pictures.
Why not just type the page's address? Fetching a page from another website would mean sending it through our server, and this tool doesn't send your files anywhere. Saving the page first keeps everything on your device.
What's kept in the PDF
- Headings, which also become bookmarks, so you can jump around a long page in any PDF reader.
- Paragraphs, bold and italic text, lists and quotes.
- Tables, laid out as real tables, with the header row in bold.
- Code blocks, in a monospaced font with their line breaks.
- Links, which stay clickable.
- Pictures embedded in the HTML, and picture files you choose together with the page.
- The page title and author, from the page's title and author tags, written into the PDF's document details.
The site's own fonts, colours, columns and CSS layout aren't copied. The PDF uses one clean, readable style, so every page looks tidy whatever the site looked like.
Main content only: no menus, sidebars or footers
Most web pages wrap their content in navigation menus, sidebars, headers and footers. With Main content only ticked (the default), the converter keeps the page's main article and leaves those out:
- if the page marks its main part (as most modern pages do), only that part is kept,
- otherwise it keeps the page body and leaves out the menus, sidebars, header and footer.
An article's own heading is kept, even when it sits in the article's header. Parts the page hides, such as closed pop-ups, are always left out, and so are scripts, forms and videos.
Untick Main content only if you want the whole page, menus and all.
Pictures from other websites
Some pages show pictures that are stored on other websites. The converter doesn't download those, because fetching them would tell those websites that you're opening the page. Instead, it tells you how many pictures it couldn't add. Tiny tracking pixels and spacers aren't counted or added.
Text encodings and languages
Older pages are often saved in an encoding other than UTF-8. The converter reads the encoding the page declares, and otherwise works it out, so accented letters such as é, ü and ñ come out right.
The PDF font covers English and other languages written in Latin, Greek or Cyrillic letters. Scripts such as Urdu, Arabic, Hindi and Chinese aren't supported yet. If a page has characters the PDF can't show, the tool tells you which ones.
Is it private?
Yes. The HTML and its pictures are read and the PDF is made in your browser. Nothing you choose or paste is sent to a server. Only a count of how many conversions you made today is sent, for the daily free limit.
Limits
One page at a time, up to 50 MB including its pictures. Pasted HTML can be up to 5 MB.
Related tools
- Going the other way? PDF to HTML turns a PDF into a clean web page.
- Writing in Markdown? Markdown to PDF makes the same kind of clean PDF from a .md file.
- Saving several pages? Convert each one, then join them with Merge PDF.
- Lots of big pictures? Compress PDF makes the PDF smaller.
HTML to PDF is free and needs no sign-up.
Frequently asked questions
How do I convert an HTML file to PDF?
Open HTML to PDF and choose your .html file, or paste the HTML code. The converter reads it in your browser and makes a clean PDF with headings, tables, links and pictures. Then click Download PDF.
How do I save a web page as a PDF?
Save the page in your browser first with Ctrl+S (Cmd+S on a Mac) and choose Webpage, Complete. Then choose the .html file together with the picture files from the folder saved next to it, and the converter makes the PDF.
Can I convert a page from its web address (URL)?
Not directly. Fetching a page from another website would mean sending it through a server, and this tool keeps everything on your device. Save the page in your browser first, then convert the saved file.
Will the PDF look exactly like the web page?
No, and that's on purpose. The page's content is laid out in one clean, readable style. Headings, paragraphs, lists, tables, code, links and pictures are kept, but the site's own fonts, colours and layout aren't. To copy the exact look, print the page to PDF from your browser instead.
Does it leave out menus and adverts?
Yes, with Main content only ticked, which is the default. The converter keeps the page's main article and leaves out menus, sidebars, headers and footers. Untick it to keep the whole page.
Is my file uploaded?
No. The HTML and its pictures are read and the PDF is made in your browser, so nothing leaves your device.