HTML to PDF
Paste HTML and get a PDF built from its headings, paragraphs, lists and code blocks — content, not CSS design.
How it works
- 1
Paste the HTML you want to convert into the text area and adjust the page settings.
- 2
The tool sanitises the HTML, then extracts headings, paragraphs, lists, code blocks and blockquotes.
- 3
Click Convert to PDF — the result is built in your browser and downloaded straight away.
Questions
Does my HTML leave my device?
No. The HTML is processed entirely in your browser. No data is sent to any server.
Why does the output not look like my web page?
This tool converts content, not design. CSS rules, custom fonts, colours, background images, grid or flexbox layout, and JavaScript-rendered content are not reproduced. You get the structured text — headings, paragraphs, lists and code — laid out with clean PDF typography.
Which HTML elements are supported?
Block-level elements: <h1>–<h6>, <p>, <div>, <li>, <pre>, and <blockquote>. Inline elements inside those blocks (such as <strong>, <em>, <a>, and <code>) are extracted as plain text. Elements outside recognised blocks are skipped.
Is the HTML sanitised before conversion?
Yes. Script tags, event-handler attributes (onclick, onerror, etc.) and javascript: URLs are stripped before any parsing takes place. The conversion is safe to run on untrusted HTML.
What happens to images and videos?
They are not included in the PDF. Only text content from recognised block elements is converted.
My <div> wraps several paragraphs — will they merge?
A <div> that directly contains text is treated as a single paragraph. If it wraps several <p> tags, each <p> becomes its own paragraph and the outer <div> is ignored. Complex nesting may produce merged blocks; restructuring the HTML or using the Markdown to PDF tool gives more predictable results.
More pdf tools
Password Protect PDF
Add a password to your PDF so only people you share it with can open or edit it.
Remove PDF Password
Strip a known password from a PDF so the file opens freely on any device.
Split PDF
Divide a PDF into separate files by single page, fixed chunk size, or your own page ranges.
Extract PDF Pages
Save the pages you choose as a new PDF, leaving the original untouched.
PDF to JPG
Render each page of a PDF as a separate JPG image at the resolution and quality you choose.
PDF to PNG
Export every page of a PDF as a lossless PNG image, with optional transparency, at the DPI you need.