No upload, 100% local, no account

HTML to PDF

Paste HTML, choose a page size, and download a PDF, everything renders in your browser.

How HTML to PDF works

HTML to PDF takes HTML markup you paste into the editor, sanitises it with DOMPurify to strip scripts and unsafe attributes, renders it on an off-screen canvas using html2canvas, and encodes the result into a PDF with jsPDF. The whole pipeline runs inside your browser tab; no HTML code or rendered output is transmitted to any server. This makes it suitable for converting HTML snippets containing personal data that you would not want to paste into an online service.

Understand the output format before you rely on it. The PDF pages are raster images, not vector text. Text in the output is not selectable, not searchable, and cannot be reflowed. External resources such as images referenced by URL are blocked by browser CORS policy and will not load. Inline styles and embedded CSS work, but complex layouts with custom web fonts or advanced CSS grid may not render accurately. For document-faithful conversion of full web pages, a headless browser running server-side is the more appropriate tool.

How to use HTML to PDF, step by step

  1. Paste your HTML markup into the editor area.
  2. Optionally adjust the page size (A4 or Letter) and the orientation.
  3. Click convert; DOMPurify sanitises the HTML and html2canvas renders it.
  4. Wait for jsPDF to encode the canvas output as PDF pages.
  5. Download the PDF.

Common use cases

  • You generated an HTML invoice in your browser from a local template and want a PDF copy without emailing it to a conversion service.
  • A simple HTML report built from API data needs to be saved as a PDF for archiving; paste the HTML and convert locally.
  • You wrote a styled HTML email template and want to preview how it would look printed as a PDF.
  • A developer needs a quick PDF from an HTML fragment during testing, without setting up a server-side headless browser.

Frequently asked questions

Why is the text in the output PDF not selectable?

The conversion pipeline renders the HTML to a canvas bitmap using html2canvas, then encodes that bitmap as image data inside the PDF pages with jsPDF. The output is a rasterised image, not a text layer. If you need a PDF with selectable text, you would need a server-side headless browser such as Puppeteer, which this tool intentionally avoids to keep processing local.

Why do images in my HTML not appear in the PDF?

Images loaded from external URLs are subject to browser CORS policy. If the image server does not send permissive CORS headers, html2canvas cannot read the pixel data and the image slot renders blank. Inline base64-encoded images embedded directly in the HTML or images from the same origin work without this restriction.

Is the HTML I paste sent to a server?

No. The HTML stays in browser memory throughout. DOMPurify sanitises it client-side, html2canvas renders it client-side, and jsPDF encodes the PDF client-side. Nothing leaves the browser tab.

What does DOMPurify sanitisation remove?

DOMPurify removes script tags, event handler attributes such as onclick and onload, javascript: URLs, and other constructs that could execute code. It preserves structural and styling markup, so the rendered output looks the same but is safe to insert into a document context.

Can I convert a full web page URL instead of pasting HTML?

No. The tool works with HTML markup you paste directly. Loading a URL would require fetching the page, which runs into CORS restrictions for most sites and would involve a network request that takes the operation outside the local processing model.