Convert HTML to PDF
Converting your file
PDF ready
Result preview
Review the complete downloaded file before sharing it.
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
Choose an HTML file
Save the page as an HTML file and select it from your device.
Review the content
Check the text preview and choose A4 or Letter. External styles, fonts and images are omitted.
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:
| Part of the HTML file | In the PDF |
|---|---|
| Headings (h1 to h6) | In the PDFYes, as headings |
| Paragraphs, quotes and preformatted text | In the PDFYes, as plain paragraphs; spacing inside code blocks is not kept |
| Lists | In the PDFYes, as bulleted items; nested items join their parent |
| Simple tables | In the PDFYes, as a grid of text |
| Links | In the PDFThe link text stays; the address does not |
| Images, video, audio and SVG | In the PDFNo |
| CSS styles and web fonts | In the PDFNo. The PDF uses PDFGym's own typeface |
| Navigation menus, footers and forms | In the PDFLeft out, which removes menus from a saved article |
| Scripts and iframes | In 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.
| PDFGym | Browser print to PDF | |
|---|---|---|
| Starts from | PDFGymA saved .html file | Browser print to PDFThe live page |
| Layout and pictures | PDFGymNo | Browser print to PDFYes |
| Menus, banners and adverts | PDFGymLeft out | Browser print to PDFUsually included |
| Loads anything from the internet | PDFGymNo | Browser print to PDFYes |
| Best for | PDFGymArticles and documents as clean text | Browser 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.
- Word to PDF Export an editable document
- PDF to Markdown Turn PDF text into Markdown
- Compress PDF Reduce the finished file size
Related PDFGym pages
- PDF to HTMLMake HTML from a PDF
- Markdown to PDFTurn a Markdown document into PDF
- Merge PDFsCombine PDF files