HTML to PDF Converter for .html and .htm Files

Convert HTML to PDF by uploading .html or .htm files: headless Chromium opens each one and prints it to an A4 PDF with its CSS and background colors. Text stays selectable, links stay clickable, and several files come back together in one ZIP.

4.9 / 5 (320)

// how it works

How to Convert HTML to PDF

Upload an HTML file and you'll get a PDF to download.

  1. 01Click 'Choose Files' and pick one or more .html or .htm files
  2. 02Look over the files you want to convert
  3. 03Click 'Convert'
  4. 04Wait while Chromium renders each file
  5. 05Download the PDF, or a ZIP if you converted several files

// why pdf-file

HTML to PDF converter features and limits

  • Fast ConversionYour HTML files get turned into PDFs quickly
  • Chromium RenderingA headless Chromium browser lays out your HTML and prints it with its CSS and backgrounds
  • Secure ProcessingWe process your files on our server and delete them automatically within two hours
  • No RegistrationNo sign-up, and you don't have to hand over any personal information
  • Free to UseIt's free, with no hidden costs
  • Cross-PlatformIt works on any device with a web browser

Everything You Need to Know About HTML to PDF

An HTML file looks right in the browser you built it for, but it's awkward to send, print or file away. Converting HTML to PDF fixes the layout into pages that open the same way everywhere. This converter takes the .html and .htm files you upload, renders them in a real browser engine and hands you the PDF.

Convert HTML to PDF for Free

How to convert HTML to PDF online

Convert one file or several at once, each up to 25 MB.

  1. Click Choose Files and pick one or more .html or .htm files.
  2. Check the list and remove any file you don't want converted.
  3. Click Convert.
  4. Download the PDF, or a ZIP with one PDF per file if you converted several.
HTML to PDF converter screen with html-to-pdf-fixture.html uploaded and the Convert button
Our test HTML file, uploaded and ready to convert. There are no settings to choose.

How the converter renders your HTML file

On our server, a headless Chromium browser opens your file, runs its scripts and waits until the page stops loading resources. Then it prints the page to PDF the way Save as PDF does in Chrome, background colors and images included.

Printing uses the page's print styles, so whatever you put in an @media print block applies. Text stays real text you can select and search, and links stay clickable.

Form fields come out the way they look on screen. You won't get fillable PDF fields. Video and animation get captured in whatever state they're in when the page prints.

Why images or CSS go missing, and how to fix it

Only the HTML file itself gets uploaded. A stylesheet or image linked with a relative path, such as css/style.css or images/logo.png, has nothing to load from, so it's left out.

Put the CSS in a style element inside the file, embed small images as data URIs, or link resources by their full public https:// address. Public addresses load; addresses on private or internal networks are blocked.

Web fonts work the same way: link them from a public URL, or the PDF falls back to a font the server has. If the page is already online, paste its address into Webpage to PDF.

Page size, margins and page breaks

By default you get A4 pages with a 20 pixel margin on every side. A CSS @page rule can change the page's dimensions, orientation and margins, and the converter uses the size you set there.

Long content flows onto as many pages as it needs. To keep a table or a heading with the text after it, use break-before or break-inside rules in your print CSS. Our guide to converting an HTML file to PDF has print CSS examples you can copy.

Long tables, page numbers and layout width in our tests

Put a long table's header in a <thead> and it repeats on every page. Our 300 row order table came out as 8 A4 pages of 353.1 KB, and each page started with the Line, Item and Amount header.

No row got cut in half at a page break, with or without a tr { break-inside: avoid } rule; both versions broke after rows 36, 75, 114 and so on. That rule matters for rows that hold several lines of text.

You can have page numbers without any setting on our side, because this Chromium prints CSS page margin boxes. A rule of @page { @bottom-center { content: "Page " counter(page) " of " counter(pages) } } put "Page 1 of 4" to "Page 4 of 4" at the foot of our 120 paragraph test file.

Responsive pages print their narrow layout, which caught us out. Our page with breakpoints at 768 and 1024 pixels printed its phone version on A4 portrait and also with @page { size: A4 landscape }, even though a script on the page reported a window 800 pixels wide. An @media print block that shows the desktop elements fixed it, and the same file then printed its desktop layout.

What happened when we tested HTML to PDF

We uploaded html-to-pdf-fixture.html, a small test file of 572 B. The converter has no options, so the file was converted as uploaded.

It took 2.4 seconds on our test server. The download, html-to-pdf-fixture_HTMLToPDF.pdf, was a one-page PDF of 38.1 KB. Tested in October 2026.

HTML to PDF results screen after converting html-to-pdf-fixture.html, with a Download button
The results screen after converting our test file.

Invoices, reports and other HTML files worth converting

Invoices, order confirmations and reports that come out as HTML are easier to approve and archive as PDFs. Saved articles and documentation pages turn into files you can read offline and mark up. Docs written in Markdown can skip the HTML step with Markdown to PDF.

Need to change the content again later? Our PDF to HTML converter goes the other way. To send several converted files as one document, combine them with Merge PDF.

Big images make big PDFs. If a file's too large to email, shrink the images in the HTML or run the PDF through one of our PDF optimization tools. Uploads get deleted automatically within two hours.

Create Your PDF from HTML Today

Frequently Asked Questions About HTML to PDF

Can I convert a complete website to PDF?

Not in one go. Convert the pages one by one, then merge the PDFs if you want a single document.

Will CSS styling be included in the PDF?

Yes, as long as the browser can reach it. CSS inside the file or on a public URL gets applied, print styles and an @page size included.

Does JavaScript run before the PDF is made?

Yes. Chromium runs the page's scripts and waits until it stops loading resources, then prints what's on the page.

Why are some images missing after conversion?

Most likely they're linked by a relative path, which can't load because only the HTML file is uploaded. Use full public URLs or embed the images in the file.

Can I search text in the converted PDF?

Yes. Text in the HTML becomes real text in the PDF. Text that only exists inside an image isn't searchable unless you run OCR on the PDF.

Are interactive forms preserved?

No. Inputs and buttons get printed as they look. They won't work as fillable PDF form fields.