HTML to PDF Converter

Paste HTML or open a saved web page with its images and stylesheets, see a live preview at the real page width, choose the paper size, margins, header, footer and page numbers, and download the PDF. A second button uses your browser's own PDF engine for files with selectable, searchable text. Nothing is uploaded.

Free · No sign-up

Page preview
Page setup
Orientation

JavaScript is off by default. Turn it on only for code you trust, for example to draw a chart before converting.

Paste HTML or open a file. The preview updates as you type.

Download PDF draws each page exactly as previewed, including web fonts and colors. Save as PDF opens your browser's print dialog: choose Save as PDF as the printer to get searchable text and working links.

Uses html2canvas (MIT), pdf-lib (MIT).

How to use it

  1. Paste your HTML, or open an .html file together with its images and CSS files.
  2. Check the preview, then choose the paper size, orientation and margins.
  3. Add a header, footer or page numbers if you need them.
  4. Click Download PDF, or Save as PDF with selectable text to use the browser's print dialog.

Why use this tool

Paste code or open files

Open an .html file with its images, fonts and stylesheets in one go; they are linked automatically.

Live preview at page width

The preview uses the real printable width of the paper, so you see where lines wrap before converting.

Page setup

A4, Letter, Legal, A3, A5, JIS B5 or a custom size, portrait or landscape, with preset or custom margins.

Clean page breaks

Cuts move to the gap between lines, and CSS page breaks such as break-before: page are respected.

Headers, footers and numbers

Add text above and below every page and numbering like 2 / 5, in any language.

Private

The conversion runs in your browser. Invoices, contracts and reports never leave your device.

Two ways to turn HTML into a PDF

Download PDF draws every page the way the preview shows it and stores each page as a high-resolution image. The result looks identical in every PDF viewer, keeps web fonts, gradients and SVG charts, and needs no print dialog. The trade-off is that the text can't be selected or searched.

Save as PDF with selectable text gives the page to your browser's print engine with the size, margins and page numbers you chose. Pick Save as PDF (or Microsoft Print to PDF) as the printer. The file keeps real text, working links and smaller file sizes, which is better for contracts, documentation and anything people will search.

Download PDFSave as PDF with selectable text
Text can be selected and searchedNoYes
Links workNoYes
Looks exactly like the previewYesVery close
File sizeLargerSmaller
Works on phonesYesDepends on the browser

Controlling page breaks with CSS

Add break-before: page to an element to start it on a new page, for example each chapter or an attachment. Use break-inside: avoid on tables rows, figures and cards that should never be split. Both methods in this tool understand these rules.

For print-only styles, put them in a @media print block: hide navigation bars and buttons with display: none, and set font sizes in points (pt) for predictable results on paper.

Converting a web page you see in the browser

Browsers don't let one website read another, so the tool can't fetch a URL. Instead, open the page, press Ctrl+S (Cmd+S on a Mac) and choose Webpage, Complete. Then open the saved .html file together with the files in its folder: images and stylesheets are linked automatically.

Pages that build their content with JavaScript may need Run the page's JavaScript turned on. Only do this for code you trust.

Paper sizes

SizeMillimetersInchesUsed in
US Letter215.9 × 279.48.5 × 11US, Canada, Mexico
US Legal215.9 × 355.68.5 × 14US legal documents
A4210 × 2978.27 × 11.69Rest of the world
A5148 × 2105.83 × 8.27Booklets, notes
Tabloid279.4 × 431.811 × 17Posters, spreadsheets

Frequently asked questions

Is the HTML uploaded to a server?

No. The preview, the drawing and the PDF are all made in your browser, so it also works with private documents.

Why can't I select the text in the downloaded PDF?

Download PDF stores each page as an image so it looks exactly like the preview. Use Save as PDF with selectable text and choose Save as PDF in the print dialog to keep real text.

Can I convert a URL to PDF?

Not directly, because browsers block reading other websites. Save the page with Ctrl+S as Webpage, Complete and open the saved file and its folder contents here.

Why are some images missing?

Images from other websites are left out of Download PDF when the site doesn't allow copying. Open the images as files together with the HTML, or use Save as PDF, which prints them normally.

How do I add page numbers?

Tick Page numbers. Download PDF adds them in the bottom corner; with Save as PDF they appear in browsers that support page margin boxes, such as recent Chrome and Edge.

Does it support CSS Grid, Flexbox and web fonts?

Yes. Both methods handle modern layouts. Web fonts load as long as they are linked from the page or opened as files with it.

Related tools

Need something built?

Tell us what you want to create.

Tell us what you need built, from a simple website to a complete app, AI solution, automation, or custom system.

Tell us what you want to build. We review every enquiry and reply by email.

Contact

Thanks, your enquiry is on its way.

We will review the details and reply by email.