Save a Webpage as a PDF

Saving a webpage as PDF paginates the rendered page — text, images and layout — into a fixed document you can keep, share or print, using the print engine already built into every browser. No converter matches it: the browser has the fully loaded page, your login session, and the fonts, so Print → Save as PDF is the best tool for this job. This page gives the exact steps in Chrome, Firefox and Safari, plus a headless command for automating it.

Why there is no one-click converter on this page

Your browser already ships the ideal webpage-to-PDF converter: its own print engine, which sees the page exactly as rendered — after JavaScript, inside your login session, with every font loaded. Any widget here would be a worse re-implementation of a button you already have, so this guide shows how to use the real one well.

Disclosure: this page contains affiliate placeholder links. If they were live, we could earn a commission at no extra cost to you.

AFFILIATE PLACEHOLDER: Recommended desktop PDF suite (placeholder link)

How to save a webpage as PDF (step by step)

Method 1 — Google Chrome (and Edge, Brave, other Chromium browsers)

  1. With the page loaded, press Ctrl+P (Windows/Linux) or ⌘P (macOS), or choose Print from the three-dot menu.
  2. In the Destination dropdown select Save as PDF instead of a printer.
  3. Under More settings, set paper size and margins, tick Background graphics if colors and images are missing from the preview, and untick Headers and footers if you do not want the URL and date printed at the page edges.
  4. Check the page count in the preview, click Save, and choose a name and location.

Method 2 — Firefox and Safari

Firefox: press Ctrl+P / ⌘P and choose Save to PDF as the destination. The same options exist — Print backgrounds and headers/footers live under the dialog's More settings section, and a scale control helps squeeze wide pages onto A4.

Safari (macOS): press ⌘P, then click the PDF button in the lower-left corner of the print dialog and choose Save as PDF. Alternatively, File → Export as PDF… saves the page in one step but as a single continuous page with no print styles applied — use the print route when you want proper pagination. For cluttered articles, click Reader mode first (the page icon in the address bar) and print that: you get clean, ad-free text.

Method 3 — Headless Chrome (automation and batches)

Chrome can print a page to PDF from the command line without opening a window:

chrome --headless --print-to-pdf=out.pdf https://example.com/article

(On macOS the binary is at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome; on Linux it is usually google-chrome or chromium.) Add --no-pdf-header-footer to suppress the default header and footer, and --virtual-time-budget=5000 to give a script-heavy page up to five seconds to finish rendering first. Wrap the command in a shell loop over a URL list to archive hundreds of pages unattended — the mechanism is identical to the dialog's Save as PDF.

How it works

Printing a page is a second, independent rendering pass. The browser re-lays the DOM against a CSS paged media context: the viewport is replaced by a page box of the chosen paper size minus margins, and any @media print rules in the site's stylesheets take effect — this is why navigation bars vanish and multi-column screens collapse to one column in the PDF. Sites can also steer pagination with properties like break-inside: avoid, which keeps a figure or table from being sliced across two pages.

The layout engine then slices the resulting content into page fragments and hands each to a PDF backend (Skia in Chromium, Quartz in Safari), which records it as vector drawing operations: positioned glyph runs referencing embedded font subsets, paths for borders and rules, and compressed images. Because this is a re-render rather than a screenshot, the output is resolution-independent and its text is selectable and searchable; only <canvas> content, which exists solely as pixels, is carried over as an image.

Two defaults trip people up. Browsers omit background colors and images when printing — a habit from the days of saving ink — so pages that draw content on dark backgrounds look broken until Background graphics is ticked. And the URL, date and page numbers at the sheet edges are generated by the browser, not the site, so they are toggled in the print dialog rather than by any page setting. Content that only loads as you scroll is a genuine limitation: if it has not been fetched when you print, it cannot appear, so scroll to the end of a long page before pressing Ctrl+P.

Worked example: archiving a long product-documentation page

Target: a documentation page of roughly 6,000 words with 14 screenshots and code samples, about 2.4 MB of loaded assets. Chrome's print preview with default settings showed 19 A4 pages; the saved PDF was 1.6 MB with fully searchable text — code samples included, because they are HTML text, not images.

Three adjustments improved it. Unticking Headers and footers removed the URL and timestamp from all 19 sheets. Ticking Background graphics restored the dark code-block backgrounds, which had printed as white-on-white. Setting scale to 90% brought the widest code sample inside the text area and dropped the count to 17 pages. The same URL through headless Chrome — chrome --headless --print-to-pdf=docs.pdf --no-pdf-header-footer https://… — produced a byte-similar 17-page file in about three seconds, confirming the two routes share one engine.

Frequently asked questions

Why does my saved PDF look different from the page on screen?

When printing, the browser applies the site's print stylesheet instead of its screen styles, which often hides navigation and ads and switches to a single column. Backgrounds are also dropped by default, so tick Background graphics if the page relies on them.

How do I save a webpage as PDF without the URL and date at the edges?

Those lines are the browser's own print headers and footers, not part of the page. Untick Headers and footers in Chrome's More settings, or the equivalent option in the Firefox and Safari print dialogs, and they disappear.

Is the text in a printed PDF selectable and searchable?

Yes. The browser writes real vector text with embedded fonts rather than a screenshot, so you can select, copy and search the PDF, and it stays sharp at any zoom. Content drawn inside canvas elements is the exception, since it is stored as an image.

Can I save a whole webpage that requires me to be logged in?

Yes, printing happens inside your session, so whatever the page shows you is what lands in the PDF. This is the standard way to keep receipts, tickets and statements from account areas that a URL-based converter could never access.

How do I convert many web pages to PDF automatically?

Use headless Chrome from a terminal: chrome --headless --print-to-pdf=out.pdf followed by the URL renders the page without opening a window. Loop over a list of URLs in a shell script to batch-archive hundreds of pages.

Why is a page cut off or blank in the PDF?

Content that loads on scroll or renders after a delay may not exist yet when the print snapshot is taken, and some print stylesheets hide entire sections. Scroll to the bottom first so lazy content loads, then print, or use reader mode to capture just the article text.

Related tools