HTML to PDF Converter
Paste HTML markup or upload an .html file, check the live preview, and export a clean paginated PDF. Rendering happens in your browser, so your markup never leaves your device.
Select an HTML file
Drag and drop a .html or .htm file, or click to browse
Loaded:
Scripts are disabled in the preview and in the exported PDF.
Rendered on your device. Your markup is never uploaded.
How to use the HTML to PDF Converter
- 1 Paste your HTML into the editor, or switch to the Upload tab and choose an .html file.
- 2 Check the live preview on the right — what you see there is what lands in the PDF.
- 3 Set the page size, orientation and margins to suit the document.
- 4 Click Convert to PDF and the file downloads immediately.
Privacy guarantee
Your markup is rendered into a hidden element on this page, screenshotted with html2canvas and written into a PDF by jsPDF — all inside your own browser tab. The HTML is never posted to a server, which matters when the page contains customer data, pricing or an unreleased design.
Frequently asked questions
Does my CSS get applied?
Yes. Inline style attributes and <style> blocks inside your HTML are applied before rendering. External stylesheets linked with <link rel="stylesheet"> are also fetched, but only if the hosting server allows cross-origin requests — many CDNs do, many private servers do not. For predictable output, paste your CSS into a <style> block.
Can I convert a live website by pasting its URL?
No, and no browser-based tool honestly can. Browser security (the same-origin policy) blocks a page from reading the contents of another website, so a URL box would only ever work for a handful of sites. Instead, open the page, use your browser’s View Source or Save Page As, and paste or upload the HTML here.
Why are some images missing from my PDF?
Images hosted on servers that do not send CORS headers cannot be read into the canvas, so they are skipped. The fix is to embed images as base64 data URIs, or host them somewhere that allows cross-origin access. Images already embedded as data URIs always work.
Is the text in the PDF selectable?
The PDF is produced by rendering your HTML to an image and placing it on the page, so text is not selectable or searchable. That is the trade-off for reproducing CSS layout faithfully in the browser. If you need selectable text, our Word to PDF converter is a better route for text-heavy documents.
How does page breaking work?
Long content is split automatically across pages at the chosen paper size. To force a break, add <div style="page-break-before: always;"></div> where you want the next page to start, or add the class html2pdf__page-break to any element.
Does JavaScript inside my HTML run?
No. Scripts are stripped before rendering, for your safety and for predictable output. Convert the finished, rendered markup rather than markup that builds itself at runtime.