Developer tools

HTML to PDF

HTML to PDF Converter

Turn HTML into a PDF with your browser's print engine: page size, margins, no upload.

About this tool

About HTML to PDF

Paste HTML, drop in an .html file, or pick one of 27 print-ready templates, from resumes, a GST invoice and quotations to certificates, a menu, a lesson plan and a newsletter, and see it laid out on the real page you choose: A4, US Letter, Legal, A3 or A5, in portrait or landscape, with margins from 0 to 50 mm. When it looks right, Save as PDF opens your browser's own print dialog, where you choose Save as PDF as the destination. That is the same engine browsers use to print web pages, so text stays selectable and sharp, CSS layouts, fonts and tables come through, and page-break rules such as break-inside: avoid are respected. Before anything is shown, the HTML is cleaned: scripts, inline event handlers, javascript: links, iframes and embedded objects are removed, and the preview runs with scripts disabled. Remote images and stylesheets are blocked unless you allow them. The conversion happens entirely on your device, so contracts, invoices and reports are never uploaded. Optional AI help can write the HTML for a document you describe, using your own AI key.

Built and maintained by Abhi JainUpdated

How to Convert HTML to PDF

  1. 1

    Add your HTML

    Paste HTML into the HTML panel, click Open to load an .html file, or pick a design from Templates.

  2. 2

    Set up the page

    Choose the Page size, Orientation and Margins, and whether to print backgrounds and colours.

  3. 3

    Check the preview

    The Preview shows the content at the printable width of your page. Anything removed for safety is listed below it.

  4. 4

    Save as PDF

    Click Save as PDF and, in the print dialog that opens, choose Save as PDF as the destination.

HTML to PDF: questions and answers

How do I convert an HTML file to PDF for free?

Open the .html file here (or paste its code), choose a page size and margins, click Save as PDF and pick Save as PDF as the printer. The PDF is created by your browser on your device, with no upload and no watermark. Afterwards you can Merge PDF, add Page Numbers or Compress PDF.

Are there ready-made templates?

Yes. Click Templates for 27 original, print-ready documents with live thumbnails: resumes, a cover letter, letterhead, GST tax invoice, quotation, receipts, certificates, tickets, a wedding invitation, menu, newsletter, lesson plan and more. Picking one sets the page size and margins too. Replace the sample text, then Save as PDF; Undo restores your own HTML.

Why are my images missing?

Remote images are blocked by default so the page makes no network requests. Turn on Load remote images and CSS, or embed images as data URLs, then save again.

How do I control page breaks?

Use CSS in your HTML: break-before: page on an element starts a new page, and break-inside: avoid keeps tables, figures and code blocks together. The tool already avoids splitting images, tables and headings where it can.

Will JavaScript in my HTML run?

No. Scripts and event handlers are removed and the preview runs with scripting disabled, so content built by JavaScript will not appear. Browsers can't write PDFs from a web page directly, so Save as PDF uses your browser's own print engine, which keeps text selectable.

Can AI write the HTML for my document?

Yes, optionally. Connect your own AI key in AI settings, click AI and describe the document, such as a one-page CV or a rent receipt. Your description and the current HTML are sent to your provider; the print-ready page it returns replaces the HTML box when you choose.