Opening your file

HTML to PDF

Convert your HTML files to PDF files

Turn HTML into a PDF with Blackpdf's free online converter. Upload an .html file or paste your code into the built-in editor, choose the page size, orientation and margins, and get a PDF rendered by a real browser engine. No installation or account needed.

  • Upload a file or paste HTML code
  • Rendered by a modern browser engine
  • Page size, margins and backgrounds

Convert HTML Pages and Code to PDF

Invoices, receipts, reports and email templates are often built in HTML, but clients and accountants want a PDF. Paste the markup or upload the file and get a print-ready document that keeps your layout and styling.

Free, Fast & Accurate HTML to PDF Converter

Two ways in, and the page settings that shape the PDF.

Paste Code or Upload

Drop in an .html or .htm file, or switch to the code editor, with syntax highlighting, line numbers and a full-screen mode, and paste your markup directly.

Real Browser Rendering

Pages are rendered by headless Chromium, the engine behind Chrome, so modern CSS such as flexbox, grid and web fonts comes out as you'd expect.

Page Setup

Choose A4, Letter, Legal or A3, portrait or landscape, and margins from none to large, so the PDF fits the paper it will be printed on.

Backgrounds On or Off

Keep background colours and images for a faithful copy of your design, or switch them off for a cleaner, ink-friendly print.

Safe by Design

The converter never fetches arbitrary URLs and screens outside requests while rendering, so pasted code can't be used to reach private systems.

Processed Securely

Your HTML is rendered on Blackpdf's servers over an encrypted connection and discarded once the PDF is created.

Your Layout, Printed Properly

Because a real browser engine does the rendering, tables, columns and fonts in your HTML come out the way they look on screen, not as a rough approximation.

It's ideal for generated documents such as invoices, statements and reports that your app or template produces as HTML.

Paste and Convert

No file to hand? Open the code editor, paste your HTML and press Convert. The editor highlights tags and counts characters so you can check what you're sending.

The same page-size, margin and background settings are available in paste mode.

How to Convert HTML to PDF

  1. 1
    Upload an HTML file or paste code
  2. 2
    Set page size, orientation and margins
  3. 3
    Choose whether to print backgrounds
  4. 4
    Convert and download the PDF

Generating PDFs from HTML often?

HTML to PDF is free. Pro raises upload limits, renders your jobs with priority, shares the result by link and removes ads.

See what Pro includes

7 day free trial. Cancel anytime.

Free Pro
HTML file upload 25MB 50MB
Rendering priority Standard Priority
Share PDF by link
Pro feature uses 10 a day Unlimited
Ads Shown None

HTML to PDF FAQs

Can I paste HTML instead of uploading a file?

Yes. Choose the paste option on the upload screen to open a code editor, paste your markup and convert it directly.

Will my CSS be applied?

Yes. The page is rendered with a Chromium browser engine, so stylesheets in the document, modern layout and web fonts are supported.

Can I convert a live web page by its URL?

No. For security the converter doesn't fetch URLs. Save the page as HTML or copy its source and convert that, or see our guide on saving a web page as a PDF.

How do I remove background colours?

Set Background to off. Colours and background images are left out, which saves ink when printing.

Is there a size limit?

Pasted or uploaded HTML can be up to 2MB of markup; uploaded files also follow your plan's file limit.

Is my HTML stored?

No. It is rendered on our servers and discarded when the PDF is ready.

HTML to PDF Tips & Guides

Send the PDF
as a link instead.

Shared file links turn the generated PDF into a link you can hand to clients, with access you control.

  • Anyone with the link, or invited people only
  • Expires after 24 hours, or revoke it early
  • Included with Pro and Business
See the plans
Done
converted.pdf
Ready to download

Error

An error occurred