HTML to PDF Converter

Paste HTML, check the preview and save it as a PDF. Inline styles and <style> blocks are applied, and the code never leaves your browser.

Your data stays in your browser

This tool runs on JavaScript inside your browser. Nothing you add here is uploaded to our server, so it works for confidential data too. How we handle data

  • No upload
  • Processed on your device
  • No account

What can I use this HTML to PDF converter for?

Anything you can write in HTML: an invoice template, a certificate, a printable report, an email newsletter you want to archive. Paste the code, check the live preview, and download a PDF. It's a quick way to test how a layout will print without setting up a PDF library on your own server.

Does it convert a web page URL?

No. It works with HTML code you paste in. To save a live web page, the easiest route is your browser's own Print dialog (Ctrl+P or Cmd+P) and choosing "Save as PDF".

How does it work, and is my code private?

The conversion happens in your browser using html2pdf.js. Your HTML is drawn onto a canvas and saved as a US Letter PDF with one-inch margins, so it never touches our server. One side effect: because the page is captured as an image, text in the PDF isn't selectable. Images loaded from other websites may also be blocked by the browser's security rules, so embed them or host them on the same site.

Writing in Markdown rather than HTML? Markdown to PDF is simpler. Need the HTML from a Markdown file first? Try Markdown to HTML. Going the other way, PDF to HTML extracts text from an existing PDF.

Questions people ask

How do I convert HTML to PDF online?

Paste your HTML into the box, click Update Preview, then Download PDF. It all runs in your browser.

Can I convert a website URL to PDF?

Not with this tool. It converts pasted HTML. For a live page, press Ctrl+P (Cmd+P on Mac) and choose Save as PDF.

Does CSS work?

Yes. Inline styles and <style> blocks are applied. External stylesheets from other sites may not load.

Why is the text in my PDF not selectable?

The converter captures the rendered page as an image before saving it as a PDF. It looks right, but the text isn't searchable.

Why are some images missing?

Browsers block images from other websites from being copied into a canvas. Use images from the same site, or embed them as Base64. Our Base64 tool can help with text data.

What paper size is the PDF?

US Letter, portrait, with one-inch margins.

Related tools