HTML to PDF (Sanitized)
Sanitize HTML markup locally with DOMPurify and export headings, lists, quotes, and tables into a clean multi-page PDF.
Related PDF tools
All PDF toolsAbout HTML to PDF (Sanitized)
Convert HTML documents into clean, multi-page downloadable PDFs locally in your browser—with strict DOMPurify sanitization that strips scripts, iframes, inline styles, and event handlers before PDF generation.
How to use HTML to PDF (Sanitized)
- 1
Paste HTML markup or load a local .html / .htm file into the source editor.
- 2
Inspect the sanitized preview on the right and select A4 or US Letter page size with optional page numbers.
- 3
Click Download PDF to lay out headings, paragraphs, lists, blockquotes, code blocks, and tables into a local PDF.
Frequently asked questions
What does DOMPurify remove before generating the PDF?
It removes <script>, <style>, <iframe>, <object>, <embed>, <form>, <svg>, javascript: URLs, and inline event handlers (like onclick/onerror) so untrusted HTML cannot execute code.
Will custom CSS layouts, web fonts, or remote images appear in the PDF?
No. To keep conversion fast, predictable, and 100% offline with no remote fetches, this tool converts semantic HTML structure (headings, text, lists, quotes, code, and tables) using standard PDF fonts.
Is my HTML document uploaded to a headless browser service?
No. Sanitization via DOMPurify and PDF generation via pdf-lib run strictly inside your browser tab.
