HTML to PDF
Render pasted HTML or an .html file into a PDF in a sandboxed frame in your browser. Scripts in the markup never run and no file is uploaded.
Reviewed 17 November 2026 · Free · No account needed
How to use
- Paste HTML or load an .html file (up to 2 MB).
- Choose a render scale: 2× suits most pages.
- Create the PDF; the markup is drawn inside a sandbox with scripts disabled.
- Download the finished file.
Example
Input: <h1>Report</h1><p>Prices in your browser.</p>
Output: html-to-pdf.pdf with the same layout
How it works
Your markup is placed in a script-disabled sandbox frame, captured to a canvas with html2canvas and embedded as an image in a PDF. If capture is blocked, the text content is extracted and laid out instead, and the result is labelled.
Limits & compatibility
- External images may be blocked by their host's CORS policy; we then fall back to a plain-text PDF and say so.
- Scripts, forms and interactive content inside the markup do not run.
- One continuous page sized to the rendered content — no automatic page breaks.
Privacy
Rendering happens in a sandboxed frame on this device. Your markup is never sent to a server, and scripts inside it are blocked.
Related tools
Questions about HTML to PDF
Can the HTML run scripts?
No. The markup is drawn into an iframe with sandboxing that does not allow scripts. Event handlers, forms and interactive widgets are inert. That is deliberate: pasting untrusted HTML should never give it code execution on your page.
Why did I get a plain-text PDF?
External images and stylesheets can be blocked by their host's CORS policy, and some strict content-security policies prevent canvas capture. When visual rendering fails we fall back to a readable text-only PDF and label the result so you know what happened.
Does it paginate long documents?
No. The output is one page sized to the rendered content. For a long article, split it into several HTML files or paste smaller sections so each PDF stays a sensible size.