›PDF Tips ›Convert ›Convert HTML to PDF

How to Convert HTML to PDF (Webpage, Email, or File)

Whether you need to save a webpage, archive an email, or convert an HTML file you have on disk, the right method depends on what you are starting with. Here is the full picture.

October 26, 2026 Convert 7 min read
Back to All Posts

Converting HTML to PDF comes up in three distinct situations: saving a live webpage as a permanent record, archiving an email as a PDF, and converting an HTML file you have saved locally. Each one has the simplest approach already built into your browser or operating system. Here is how to handle all three, plus when you might need something more capable.

Converting a Webpage to PDF (Any Browser)

Every modern browser can save any webpage as a PDF using the built-in print dialog. This is the fastest and most reliable method and requires no additional tools.

Chrome, Edge, and Firefox (Windows and Mac)

  1. Navigate to the webpage you want to save.
  2. Press Ctrl+P (Windows) or Cmd+P (Mac) to open the Print dialog.
  3. In the Destination or Printer field, select Save as PDF.
  4. Adjust settings if needed: paper size, margins, whether to include headers and footers (the URL and page number Chrome adds by default), and whether to include background graphics.
  5. Click Save and choose a location on your computer.
Tip: Remove the URL header and footer. Chrome includes the page URL and the date in the header and footer of print-to-PDF output by default. To remove them, in the print dialog click More settings and uncheck Headers and footers. This produces a cleaner document, especially for archiving articles or saving content to share.

Safari on Mac

  1. Open the webpage in Safari.
  2. Click File → Export as PDF (not Print). This option produces a better PDF than printing from Safari because it does not paginate the content the same way the print dialog does.
  3. Name the file and choose a save location.

iPhone and iPad

  1. Open the webpage in Safari.
  2. Tap the Share icon at the bottom of the screen.
  3. Scroll left through the top row of icons and tap Options.
  4. Select PDF from the format options.
  5. Tap Done, then tap Save to Files.

This produces a full-length PDF of the webpage, not just what is visible on screen.

Android

  1. Open the webpage in Chrome.
  2. Tap the three-dot menu and select Share.
  3. Tap Print.
  4. In the print dialog, tap the printer dropdown and select Save as PDF.
  5. Tap the PDF icon to save.

Converting an Email to PDF

Emails are HTML documents rendered in an email client. The easiest way to save any email as a PDF is to use the same print-to-PDF method:

  • Gmail (browser): open the email, click the three-dot menu in the top right of the message, and choose Print. In the print dialog, select Save as PDF.
  • Outlook (desktop): open the email, click File → Print, and select Microsoft Print to PDF (Windows) or Save as PDF (Mac) as the printer.
  • Apple Mail (Mac): open the email, click File → Export as PDF.
  • Gmail (iPhone): open the email, tap the three-dot menu, tap Print, and use the Share icon that appears to save as PDF using the Safari/Files method above.

Converting a Local HTML File to PDF

If you have an HTML file saved on your computer (an exported report, a saved webpage, a template), open it in any browser and use the print-to-PDF method above. The file does not need to be live on the web.

  1. Drag the HTML file into a Chrome or Edge browser window, or right-click the file and choose Open with → Chrome.
  2. The HTML renders in the browser just like a live webpage.
  3. Press Ctrl+P (or Cmd+P on Mac) and save as PDF.

If the HTML file references external CSS, JavaScript, or images, those will only load if the files are in the expected location relative to the HTML file. A single self-contained HTML file with inline styles converts cleanly. HTML files that depend on a web server or external CDN resources may render with missing styles or images.

When Browser Print-to-PDF Is Not Enough

The browser method is simple and free, but it has limitations that matter in some situations:

  • Dynamic content: content that loads after the initial page render (lazy-loaded images, JavaScript-rendered text) may not appear in the PDF. For pages with significant dynamic content, you may need to scroll to the bottom to trigger loading before printing.
  • Pagination: long pages may paginate awkwardly, cutting a section or table mid-element. Some browser settings let you adjust margins to reduce this, but control is limited.
  • Login-protected pages: the browser converts what it can render, so any page you are logged into can be saved. But this also means automated tools cannot convert pages that require authentication.
  • Batch conversion of many HTML files: if you need to convert dozens of HTML files to PDF automatically, command-line tools like wkhtmltopdf or headless Chrome are more practical than using the GUI.

For developers needing programmatic HTML-to-PDF conversion, command-line tools like wkhtmltopdf and headless Chrome are the most widely used options and have extensive documentation on their respective project sites.

What Survives the Conversion

Content TypeConverts Well?Notes
Text content✅ YesFully preserved and selectable in the PDF
Static images✅ YesEmbedded at screen resolution
CSS layout and styling✅ MostlyPrint CSS may differ from screen CSS
Hyperlinks✅ YesLinks remain clickable in the PDF
Video and audio❌ NoMedia elements are omitted
Animations and transitions❌ NoCaptured as static state at time of conversion
Interactive elements (forms, dropdowns)⚠️ PartialRendered as static visual; not interactive in PDF
Lazy-loaded content⚠️ VariableScroll to trigger loading before printing
Key Takeaways
  • Ctrl+P (or Cmd+P) then "Save as PDF" is the universal method for converting any webpage or HTML file to PDF in any browser
  • In Chrome, uncheck Headers and Footers under More Settings for a cleaner output without the URL and date
  • Safari on Mac has a dedicated File → Export as PDF option that often produces better output than Print
  • On iPhone, use Safari's Share sheet, tap Options, and select PDF format before saving to Files
  • Emails convert to PDF the same way: open in browser or desktop client and use the print-to-PDF method
  • Local HTML files can be dragged into Chrome and converted the same way as live webpages

Need to compress, merge, or edit your converted PDF?

PDFToolShack has 28 free browser-based PDF tools for everything you need after conversion.

Browse Free Tools
Free PDF tools to merge, compress and convert PDFs