HTML to PDF
Open an HTML file here and save it as a PDF from your browser's own print dialog: the browser writes the PDF on your device, so the file is never uploaded.
How to convert an HTML file to PDF
Open the HTML file
Drop the file on the box above, or press Choose a file. If the page uses its own images and stylesheets, add its folder or a ZIP of it so they are in the PDF.
Check the page
Look over the page in the preview. If its images or fonts come from the web, choose Load remote files. If part of the page is drawn by scripts, choose Run scripts first.
Choose Save as PDF
Choose Save as PDF. Your browser's print dialog opens with the page alone, without this site around it.
Pick "Save as PDF" as the printer
In the print dialog, choose "Save as PDF" where you would choose a printer, then save the file.
To read the page without converting it, use the HTML viewer. Other ways to open a file on each device: how to open an HTML file.
How the HTML to PDF conversion works
No server converts your file. The page is opened in your browser, and the PDF is written by the browser's own print function, the one that saves any web page as a PDF. In the script-free preview the viewer replaces each link with a placeholder of its own, so that it can answer clicks itself. When you print, links to web and email addresses get their addresses back, so a browser that keeps links in the PDFs it saves keeps them. A link to another file of a folder or ZIP prints as plain text.
The browser lays the page out for paper. The viewer keeps the page's styles, print styles included: if the page has CSS inside @media print, as MDN's guide to printing describes, the browser uses it, so a page written for printing comes out as it was written.
Where to find the option depends on the system. On a Mac, Apple's guide says to click the PDF button or open the PDF pop-up menu in the print dialog and choose Save as PDF. In Chrome on a computer, you select the destination in the print window, and Save as PDF is one of them. In Chrome on Android, Google's help says to tap Save as PDF where the printer is chosen. On Windows, Microsoft notes that the Microsoft Print to PDF printer included in Windows 10 and 11 also writes a PDF.
Convert HTML to PDF without uploading
Many online HTML to PDF converters ask you to upload the file, convert it on their server and send a PDF back. Here the file is read by your browser and the PDF is made by your browser's print function. The file never leaves your device, and the page works with no internet connection once it has loaded. How to check that nothing is uploaded has the steps.
That matters when the file is a saved statement or receipt, a report exported from other software, or a page you keep as a record.
Images, colors and page headers in the PDF
Images and stylesheets saved beside the page are in the PDF when you add the folder or a ZIP of it. Images and fonts on the web are in it only after you choose Load remote files.
If colors or background images are missing from the PDF, Microsoft's guide to printing in Edge says to select More settings, then Background graphics. The same guide says that the Headers and footers setting under More settings adds the date and page numbers. Browsers can also print a title and an address there: for a page printed here, the title is the one in the page's <title> element and the address is one of htmlviewer.app's, because the page is shown on a page of this site. Clear Headers and footers for a PDF without them.
HTML pages built by scripts
Some HTML files show little until their scripts run, such as reports with charts or pages that build a table from data inside the file. Choose Run scripts before Save as PDF. The page then runs in a sealed frame with no internet access, and the PDF shows the page as the scripts left it.
One file at a time, and who that suits
A browser shows its print dialog for every print, so each page is saved by hand. That suits a few files. It is not a converter for hundreds of files or for a program that makes PDFs on a server: that job needs a headless browser or a PDF library called from code.
It also does not convert a web page by its address, because fetching another site needs a server. To make a PDF of a page you have open in your browser, print it there and choose Save as PDF.
Frequently asked questions
How do I open an HTML file as a PDF?
Open the HTML file on this page, choose Save as PDF and pick "Save as PDF" as the printer in your browser's print dialog. The browser writes the PDF on your device, and any PDF reader opens it.
How do I convert an HTML file to PDF on iPhone?
Save as PDF here asks Safari to print the page, but it has not been tested on an iPhone yet. Apple's iPhone guide documents printing through AirPrint and names no Save as PDF choice in its print steps, so we cannot yet say whether an iPhone saves the PDF to Files from this page.
Can I convert MHTML to PDF?
Yes. Open the MHT or MHTML file in the same box here and choose Save as PDF, or open it in the MHTML viewer and choose Print / Save as PDF. The images saved inside the file are in the PDF.
How do I convert an HTML file into a readable format?
To read it, open it here: the file is shown as a page, not as code. For a file anyone can open, save it as a PDF. To read the code itself, choose Code.
Can I convert an HTML file to a Word document here?
No. This page makes PDFs through your browser's print dialog and saves HTML files. It does not write Word documents.
Is it free, and is there a watermark?
It is free, with no account, and the site adds no watermark or text of its own to the PDF. A header or footer with the date or page numbers comes from your browser's print settings, and you can turn it off there.
Is my HTML file uploaded?
No. The file is read in your browser and never leaves your device. The site counts visits with Google Analytics, which never receives your files, their names or their contents, and it has no session recording.