HTML to PDF

Convert HTML to PDF online for free — paste HTML code or open an .html file and save it as a PDF, keeping your inline styles and <style> blocks. Choose A4, Letter or Legal and margins, preview the result, then save with selectable text. 100% in your browser.

100% private — everything runs in your browser. Conversion happens on your device; nothing is uploaded.

100% private — runs in your browser

Inline styles and <style> blocks are kept; scripts are removed for safety, so pages that need JavaScript to draw their content won’t convert fully. Images must be absolute URLs (https://…) or data URIs. “Save as PDF” keeps text selectable. Your code never leaves your device.

How to convert HTML to PDF

  1. Paste your HTML, or open an .html file.
  2. Choose page size, margins and whether to add default styles.
  3. Check the preview.
  4. Click “Save as PDF”, or download an image PDF.

What you can use it for

  • Turn HTML invoices, receipts and reports into PDFs
  • Save HTML email templates as PDF for approval
  • Archive a page of code output or a generated report
  • Print styled HTML documents with proper page sizes

More free tools

Working with PDFs?

Merge, split, compress, protect and convert PDFs with our free, private PDF tools.

See all free PDF tools →

Frequently asked questions

How do I convert an HTML file to PDF?

Open the .html file (or paste its code), choose a page size, and click Save as PDF. In the print dialog choose “Save as PDF” as the destination.

Is CSS supported?

Yes — inline styles and &lt;style&gt; blocks are kept, including print rules. External stylesheets load if they're on a public https:// address.

Does JavaScript run?

No. Scripts are removed for safety, so pages that build their content with JavaScript won't convert fully. Use your browser's own print on the live page for those.

Can I convert a web page by URL?

Not directly — browsers block reading other sites' pages. Open the page, then use your browser's Print → Save as PDF, or save the page's HTML and open it here.

How do I control page breaks?

Add CSS such as <code>break-before: page</code> to an element to start it on a new page. Tables, images and code blocks are kept together automatically where possible.

Is my code uploaded?

No. Everything runs in your browser.