HTML to PDF

Paste HTML or open an .html file, see it laid out live, then save it as a PDF. Choose your page size, orientation and margins. Two ways out: print for real selectable text, or download in one click.

  • ProcessingOn your device
  • Uploaded to a serverNothing
  • InternetNot needed

Don't take our word for it. Turn off your Wi‑Fi, then use this tool. It will work exactly the same, which is only possible because your file never goes anywhere.

Worth knowing

Because everything runs in your browser, this converts HTML you paste or open — it can't fetch a URL for you. Copy the page source, or use your browser's own Print to PDF on a live page.

The one-click Download turns the page into an image, so its text can't be selected afterwards. Print keeps the text real — for most documents that's the better PDF, and the tool says so.

Images hosted on other websites usually won't render, because the browser won't let one site read another's pictures. Embed them as data URIs if they have to appear.

Your HTML

Preview

Scripts in your HTML never run. Images hosted on other sites may not appear — embed them as data URIs if they must be included.

Print — best quality

Uses your browser's own print engine, so the text stays real — selectable, searchable and sharp at any zoom. Choose Save as PDF as the destination.

Download — one click

Renders the page to an image and wraps it in a PDF. Matches complicated CSS exactly, and breaks pages between lines rather than through them — but the text becomes part of the picture.

Why there are two buttons

Your browser already contains an excellent HTML layout engine and PDF writer — its print pipeline. Nothing written in JavaScript beats it, so for most documents Print gives you the better file. Download exists for when you want it done in one click without a dialog, or when the layout depends on CSS the print path renders differently.

Worth knowing

Because everything runs in your browser, this converts HTML you paste or open — it can't fetch a URL for you. Copy the page source, or use your browser's own Print to PDF on a live page.

The one-click Download turns the page into an image, so its text can't be selected afterwards. Print keeps the text real — for most documents that's the better PDF, and the tool says so.

Images hosted on other websites usually won't render, because the browser won't let one site read another's pictures. Embed them as data URIs if they have to appear.

Getting the page you expected

Converting HTML to PDF means laying out a design built for a scrolling window onto fixed sheets of paper. Most surprises come from that one difference rather than from anything going wrong.

  • Backgrounds are often dropped, because print styles usually suppress them. Set them explicitly if they matter.
  • Anything positioned relative to the viewport has no viewport to attach to, and lands somewhere unexpected.
  • Web fonts have to be reachable at conversion time or the text falls back to a default.
  • Content is split at page boundaries, which can cut a table or an image in half.

Printing to PDF from the preview gives the best fidelity, because the browser's own print engine does the layout — the same engine that renders the page. Downloading directly is quicker and usually close enough.

Related reading: shrinking the PDF you just generated.

Questions people ask

Why can't I just paste a link?

Browsers block one site from reading another site's pages. Fetching URLs would need a server, which would mean hosting costs and your data leaving your device.

Should I use Print or Download?

Print, for almost everything. It uses your browser's own print engine, so the text stays selectable and searchable and stays sharp at any zoom. Download is for when you want it in one click without a dialog.

Will my page break in the middle of a line?

It tries hard not to. Before cutting a page it looks for a band of blank space nearby and breaks there instead, so lines and table rows stay whole.

Do scripts in my HTML run?

No. The preview is sandboxed with scripting disabled, and script tags are stripped before anything is rendered.

How to use it

Works well with