Convert HTML to PDF

or drop one here
Choose HTML first.

Make a searchable PDF from the readable content of a saved HTML file. The converter extracts headings, paragraphs, lists and simple tables, then lays them out as PDF pages. It does not run scripts or fetch external assets, and it does not make a screenshot of the original page design.

How to convert HTML to PDF

  1. Choose an HTML file

    Save the page as an HTML file and select it from your device.

  2. Review the content

    Check the text preview and choose A4 or Letter. External styles, fonts and images are omitted.

  3. Convert and download

    The PDF is reopened and its text is checked before download.

What this conversion keeps

This tool is for an article or document stored as HTML. It ignores scripts, stylesheets, external images and complex layouts so that a local file does not load third-party resources during conversion. If you need the exact appearance of a live webpage, use the browser’s Print to PDF command instead.

What comes across and what does not

The converter reads the HTML as data, keeps the readable content and sets it on PDF pages. It never loads the page the way a browser does, so nothing from the original design comes along. The full list:

What an HTML to PDF conversion keeps
Part of the HTML fileIn the PDF
Headings (h1 to h6)In the PDFYes, as headings
Paragraphs, quotes and preformatted textIn the PDFYes, as plain paragraphs; spacing inside code blocks is not kept
ListsIn the PDFYes, as bulleted items; nested items join their parent
Simple tablesIn the PDFYes, as a grid of text
LinksIn the PDFThe link text stays; the address does not
Images, video, audio and SVGIn the PDFNo
CSS styles and web fontsIn the PDFNo. The PDF uses PDFGym's own typeface
Navigation menus, footers and formsIn the PDFLeft out, which removes menus from a saved article
Scripts and iframesIn the PDFNever run and never loaded

Saving a web page as HTML first

In any desktop browser, press Ctrl+S (Cmd+S on a Mac) and save the page. Either Webpage, HTML Only or Webpage, Complete works: this tool reads only the .html file and ignores the folder of images next to it. On a phone, saving HTML is often hidden, so this route is easier on a computer.

Some sites build their content with JavaScript after the page loads. Saved as HTML, such a page can be almost empty, and the converter then reports that it found no readable headings, paragraphs, lists or tables. For those pages, print from the browser instead.

Browser print versus this converter

The browser's Print command with Save as PDF keeps the page as it looks, including the layout and pictures, and also the menus, cookie notices and adverts. Reader view, where your browser offers it, strips most of that before you print. This converter starts from the saved file instead, so you can convert later and offline, and the result is a clean, searchable text PDF.

The file is also treated as untrusted. Image, video and script tags are removed before the HTML is parsed, so opening a saved page here never sends a request to the site it came from or to any tracker it contained.

Two ways to make a PDF from a web page
PDFGymBrowser print to PDF
Starts fromPDFGymA saved .html fileBrowser print to PDFThe live page
Layout and picturesPDFGymNoBrowser print to PDFYes
Menus, banners and advertsPDFGymLeft outBrowser print to PDFUsually included
Loads anything from the internetPDFGymNoBrowser print to PDFYes
Best forPDFGymArticles and documents as clean textBrowser print to PDFKeeping the look of the page

Your file stays in this browser tab

The converter loads its code when you open the page. Once you choose a file, conversion happens on your device. The file itself is not sent to PDFGym. Close or refresh the tab to clear the selected file and preview from the page.

Convert HTML to PDF frequently asked questions

Does it convert a website URL?
No. Save the HTML file first. This page does not fetch a URL.
Will CSS and images appear?
No. The PDF contains readable text, headings, lists and simple tables. It does not copy page design.
Can the PDF be searched?
Yes. The converter creates text-based PDF pages and verifies their extracted text.
Will scripts from my HTML run?
No. HTML is parsed as data and scripts are never inserted into the live page.
Can I convert an email saved as HTML?
Yes, if it is saved as an .html or .htm file. Files ending in .eml or .mht are not accepted.
Why is my PDF almost empty?
The page probably loads its text with JavaScript, so the saved file holds little content. Use your browser's Print command with Save as PDF for that page.
Is there a file size limit?
No limit is coded into the tool. Very large files depend on your browser's memory.
Does it keep code formatting?
No. Preformatted text becomes a normal paragraph, so indentation and line breaks inside code blocks are lost.

Other PDFGym tools

Choose the next tool for the result you need.

Related PDFGym pages