Skip to content
Free tool · No signup · Nothing to install

HTML to PDF: Convert Any Web Page to PDF

Enter a page address and get back a PDF of the page as a browser draws it: styles, fonts, images and JavaScript-built content included. Pick the paper, the orientation and the margins, or print the whole page as one long sheet.

Paper size
Orientation
Margins

Rendered in a real Chrome: styles, fonts, images and JavaScript included. Takes a few seconds.

How to convert a web page to PDF

  1. 1

    Enter a page address

    Any public page works: an article, an invoice page, a docs page, a dashboard that needs no login.

  2. 2

    Choose the layout

    A4 or Letter, portrait or landscape, three margin presets, or a single page as tall as the site.

  3. 3

    Convert and download

    A headless Chrome loads the page, waits for it to settle and prints it. Preview the PDF here, then save it.

Page size, orientation and margins

  • A4 or Letter

    A4 (210 × 297 mm) is the paper size almost everywhere; Letter (8.5 × 11 in) is the US and Canadian standard.

  • Portrait or landscape

    Landscape gives wide tables, dashboards and code a page that fits them, so fewer lines wrap.

  • Margins

    None prints edge to edge, small leaves a quarter inch, and default leaves half an inch on every side.

  • Single long page

    Skips page breaks and prints the page at desktop width on one sheet as tall as the document, like a full-page screenshot that keeps text selectable.

What the PDF keeps, and what it cannot reach

  • Styles and web fonts

    Stylesheets and web fonts load, and backgrounds are printed, so the PDF keeps the colours of the site.

  • JavaScript-built content

    Pages that render in the browser are rendered here too. The page is scrolled once so lazy images load before printing.

  • Links and text

    Text stays text: it can be selected, searched and copied, and links in the PDF still open their pages.

  • Screen styles, not print styles

    The page is printed with its screen styles, so it looks the way it does in a browser rather than in a print preview.

  • Not cleared: cookie banners

    Consent banners and chat widgets are part of the page, so they print. Nothing is clicked on your behalf.

  • Not reached: private pages

    The browser carries no cookies or session, so anything behind a login prints as the login page.

When this free tool is not enough

  • One page, 25 seconds. Each PDF is one address. A page that has not loaded within 25 seconds is reported rather than printed half-drawn. Fair use is 10 PDFs a minute.

  • Size ceilings. A PDF can be up to 20 MB. A single long page stops at 19,200 pixels, the 200-inch maximum a PDF page can be; longer pages are cut and the tool says so.

  • Blocks and challenges. A site that answers with a CAPTCHA, a challenge page or a 403, 429 or 503 is not printed. The tool says the site blocked it and links to the MrScraper app, which can scrape the page instead.

A PDF is a picture of one page for a person to read. Pulling the data itself out of thousands of JavaScript-rendered pages, on a schedule, is what MrScraper's Web Scraper API does.

How to convert HTML to PDF with code

Load the page in a headless browser, let it finish rendering, and call its print-to-PDF function.

Python
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch()
    page = browser.new_page()
    page.goto("https://example.com", wait_until="networkidle")
    page.emulate_media(media="screen")
    page.pdf(path="page.pdf", format="A4", print_background=True)
    browser.close()
JavaScript
import puppeteer from 'puppeteer'

const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto('https://example.com', { waitUntil: 'networkidle2' })
await page.emulateMediaType('screen')
await page.pdf({ path: 'page.pdf', format: 'A4', printBackground: true })
await browser.close()

HTML to PDF FAQ

How do I convert a web page to PDF?

Paste the page URL into an HTML-to-PDF converter, choose a paper size and orientation, and download the file it returns. The converter on this page loads the address in a headless Chrome, waits for the page to settle, scrolls it once so lazy images load, and prints it with backgrounds and web fonts included.

Is this HTML to PDF converter free?

The HTML to PDF converter on this page is free, with no account, email or watermark. Each visitor can create 10 PDFs a minute, and each PDF covers one address, renders for up to 25 seconds and can be up to 20 MB. The limits keep the shared browser fast for everyone rather than pushing anyone to a paid plan.

Can I convert a JavaScript-rendered page to PDF?

JavaScript-rendered pages convert correctly because the tool uses a real browser rather than reading the server HTML. Single-page apps, charts and content loaded after the first paint are drawn before printing. Pages that only load more content when a button is pressed or a form is filled in print what is visible without that interaction.

What is the difference between A4 and Letter?

A4 measures 210 by 297 millimetres and is the standard paper size in most of the world, while Letter measures 8.5 by 11 inches and is used mainly in the United States and Canada. Letter is slightly wider and shorter, so the same page can break onto a different number of sheets in each format.

How do I save a whole web page as one PDF page?

Tick the single long page option and the converter prints the page at desktop width on one sheet as tall as the document. The result reads like a full-page screenshot, but the text stays selectable and the links still work. Pages taller than 19,200 pixels, the maximum height of a PDF page, are cut at that point.

Why does my PDF include a cookie banner?

Cookie banners appear in the PDF because they are part of the page the browser loaded, and the converter never clicks anything on your behalf. Accepting or rejecting consent for you would be a choice made in your name. When a clean copy matters, convert a page that does not show a banner, or print it from your own browser.

Can I convert a page that needs a login?

Pages behind a login cannot be converted here, because the browser that loads them carries no cookies and no session of yours. A page that requires signing in prints as its login screen. For a private page, open it in your own browser and use the print dialog, choosing Save as PDF as the destination.

How do I convert HTML to PDF in Python?

Python can convert HTML to PDF with Playwright, which drives a real Chromium and calls page.pdf with a format and print_background setting, as shown in the code section above. WeasyPrint is the usual choice when the HTML is your own template rather than a live site, because it needs no browser but runs no JavaScript.

Does the PDF keep links and selectable text?

Links and text survive the conversion, because the browser prints the page as vector text rather than as an image. You can select, search and copy the text in any PDF reader, and links still open the pages they pointed to. Images stay images, and their quality matches the size the page displays them at.

Why did my PDF conversion fail?

A conversion fails when the page does not finish loading within 25 seconds, answers with an error status, or blocks automated browsers. When a site blocks the browser, the tool says so and links to the MrScraper app, which can scrape it. Private and local addresses are refused, including redirects to one, and a PDF over 20 MB is not returned.

Your choices

Cookie preferences

Necessary cookies keep your selection. Optional categories are disabled until you switch them on.

Strictly necessary

Remembers your privacy selection and keeps the site working.

Always on