Convert HTML to PDF
To convert HTML to PDF, open the page in Chrome, Edge, Safari or Firefox, press Ctrl+P (Cmd+P on Mac) and choose Save as PDF as the destination. PDF Viewer on this site does not render web pages into PDFs; it opens the PDF you saved so you can annotate, highlight and search it in the browser. This guide covers the print dialog settings that matter and the command-line options for automation.
Which HTML to PDF method for which case
| Case | Method | Notes |
|---|---|---|
| Any web page, any OS | Chrome or Edge, Print, Save as PDF | Keeps links; honors the site's print stylesheet |
| Mac, any browser | Print, PDF menu, Save as PDF | System-wide, works in Safari |
| Firefox | Print, Destination: Save to PDF | Own print engine, good for long pages |
| Reader-style, no ads or sidebars | Reader view first, then print | Safari and Firefox Reader; Edge Immersive Reader |
| Local HTML file or report | Open the file in a browser, print | Same dialog |
| Automation, many URLs | headless Chrome --print-to-pdf, wkhtmltopdf, Playwright | Scriptable, headless |
| Whole page as one tall image-like page | GoFullPage-style extension, or Playwright with a custom page height | Not paginated |
Online HTML to PDF services exist for public URLs; for pages behind a login they would need your session, which is a good reason to stay in your own browser.
Main method: Print to PDF in Chrome or Edge
- Open the page and wait for it to load fully; lazy-loaded images that have not appeared will print as blanks. Scroll to the bottom once.
- Press Ctrl+P (Cmd+P on Mac).
- Destination: Save as PDF.
- Expand More settings. Paper size Letter or A4; Margins Default or Minimum; Scale 100 or less if columns are cut off.
- Tick Background graphics if the page relies on colored boxes or dark themes. Untick Headers and footers to drop the URL and date lines.
- Set Pages to a range if you only need part of a long article.
- Click Save and name the file.
Safari on Mac: File, Print, then the PDF button at the bottom, Save as PDF. Firefox: Ctrl+P, Destination Save to PDF; Firefox also offers Simplify Page in the preview. Windows apps without their own PDF export can print to Microsoft Print to PDF the same way.
Command line: chrome --headless --print-to-pdf=page.pdf https://example.com (use the full path to the Chrome or Edge executable). wkhtmltopdf and Playwright's page.pdf() give more control over headers, page size and waiting for JavaScript.
What goes wrong and why
- Content cut off at the right edge. The page has a fixed-width layout wider than the paper. Lower Scale, use Landscape, or switch to Reader view.
- Missing backgrounds and icons. Background graphics is off by default; icon fonts sometimes do not print at all.
- Blank pages. Caused by the site's print CSS or page-break rules; printing from Reader view usually fixes it.
- Expanded menus, cookie banners, sticky headers repeat on every page. Close them before printing or use Reader view.
- Links. Chrome, Edge and Safari keep clickable links; the Microsoft Print to PDF printer flattens them.
- Dynamic content loaded after you scroll or click is not on the page yet; scroll through first.
If what you really wanted was a picture of the page, a screenshot plus PNG to PDF is simpler. For documents that start in an editor, see Word to PDF.
Reader view and print stylesheets: why the same page prints differently
A web page can carry a separate stylesheet for printing (CSS @media print). Well-made sites use it to hide navigation, expand collapsed sections and put the URL after each link. Sites without one print exactly what you see on screen, including sticky headers that repeat on every page. That is why one article prints cleanly and another is a mess: the result depends on the site, not your browser.
Reader view is the fix when the site did not do the work. Safari (the icon in the address bar), Firefox (Reader view button) and Edge (Immersive Reader) strip the page down to title, text and images, and the print dialog then paginates that clean version. Chrome has no built-in reader for printing, but Firefox's Simplify Page in the print preview does the same job. For your own HTML, add a print stylesheet with sensible page margins and page-break-inside: avoid on tables, and the PDF comes out right in every browser.
Check the result
Open the saved file in the online PDF viewer. Scroll the thumbnails for blank or half-empty pages, use Ctrl+F to confirm the text is searchable, and zoom in on images. Then mark it up: highlight the parts you need, delete the pages of comments you printed by accident, and download. Nothing is uploaded, so pages from your bank or your company intranet are safe to check here.
Frequently asked questions
How do I save a web page as a PDF?
Press Ctrl+P (Cmd+P on Mac) in the browser and choose Save as PDF as the destination. This works in Chrome, Edge, Firefox and Safari.
How to convert HTML to PDF without losing formatting?
Turn on Background graphics in the print dialog, keep Scale at 100, and print from the browser the site was designed for. Reader view trades layout for clean text.
How to convert a local HTML file to PDF?
Open the .html file in any browser (drag it into a tab) and print it to PDF the same way as a web page.
How to convert HTML to PDF from the command line?
Run Chrome headless with --print-to-pdf, or use wkhtmltopdf or Playwright for scripts that need headers, footers and waits.
Why is my web page PDF cut off on the right?
The layout is wider than the paper. Reduce Scale in the print dialog, pick Landscape, or print from Reader view.
Can this PDF viewer convert a web page to PDF?
No. Save the PDF from your browser's print dialog, then open it here to highlight, annotate and search it without uploading.