HTML to PDF converter
Print HTML to a clean PDF, in your browser, sanitised before rendering. Nothing is uploaded.
How to html to pdf
- Paste your HTML into the box, or press "Load a file instead" and choose an .html file.
- Pick the page size: A4 or Letter.
- Press Convert. The HTML is sanitised, rendered off-screen and printed to PDF.
- Download document.pdf.
Sanitised first, rendered second
Whatever you paste goes through DOMPurify before a single pixel is drawn: script tags, event handlers (onclick and friends), javascript: URLs and other active content are stripped. What remains is pure structure — headings, paragraphs, lists, tables, images and links — rasterised with html2canvas and printed to an A4 or Letter PDF.
This is why pasting untrusted HTML is safe here: the sanitizer runs before rendering, in your own tab, and the output is a PDF — not live HTML. The tool is equally happy with a fragment (a single styled table) or a full document (html and body tags are handled).
The render width is fixed at 794 pixels — the CSS-pixel width of an A4 sheet — so line breaks in the PDF match what a browser would print, regardless of your window size.
Limits and honest notes
External assets do not load: a style tag is removed, and images pointing at other servers cannot be fetched (that would break the privacy promise). Inline images as data URIs render perfectly. Inline CSS inside style attributes works; a page-wide stylesheet does not.
Very complex CSS (grid-heavy layouts, web fonts) renders approximately, because the print engine uses html2canvas rather than the browser print pipeline. For pixel-perfect pages, print to PDF from the browser itself; for fast, private, one-click PDFs of content, this is the tool.
Up to 50 MB of HTML per run. Everything runs in this tab; nothing is uploaded.
Frequently asked questions
Is my HTML safe to paste here even if I did not write it?
Yes. DOMPurify strips scripts, handlers and dangerous URLs before rendering. The output is a PDF, not live HTML.
Why did my external images disappear?
Remote images are not fetched — that would send a request to another server. Inline them as data URIs, or embed them in the HTML directly.
Does my CSS in a style tag work?
Style tags are removed for safety. Inline style attributes (style="...") are kept.
Can I convert a whole saved web page?
You can convert the saved .html file, but external assets will be missing. Pages saved as "complete" with local files render closest to the original.
Private by design
Stays on your device. Nothing is uploaded. The conversion runs in your browser: open the Network tab while you convert and you will see that nothing is sent. No account, no watermark, no daily limit.