HTML to PDF

Paste HTML or open an .html file, preview it on real page sizes and save it as a PDF through your browser's print dialog. The page's own styles are kept; scripts are removed.

Page size
Margins
Font

INPUT

0 characters0 lines

PREVIEW

The page preview appears here once you paste HTML.

Your browser's print window opens. Choose “Save as PDF” as the printer to get a PDF file.

Runs entirely in your browser. Nothing you enter is sent to a server.

How to convert HTML to PDF

  1. Paste or open HTML

    Paste the code of an invoice, a report or an email template, or open an .html file.

  2. Set up the page

    Choose the page size and margins, whether to keep the page's own styles and whether to print backgrounds.

  3. Save as PDF

    Click Print or save as PDF and choose “Save as PDF” as the printer.

What is kept

The page's HTML and the CSS in its style blocks and style attributes, including print rules such as @page sizes and page breaks. Stylesheets linked with a link tag aren't loaded, scripts don't run, and anything that could run code is removed with DOMPurify.

Text stays text

The browser creates the PDF, so text stays selectable and searchable, links stay clickable, and Arabic, Hindi and other scripts are shaped correctly.

Frequently asked questions

Is my HTML uploaded?

No. It's shown and printed by your browser. Images or fonts that your HTML links to on other websites are loaded from those sites, as when you open the file in a browser.

Why does my page look different?

Scripts don't run, so content built by JavaScript won't appear, and linked stylesheets aren't loaded. Put the CSS in a style block in the HTML instead.

How do I remove the date and URL at the top?

Turn off “Headers and footers” in the print dialog's settings.