Skip to content
New: Go-to-market lead lists, 5X cheaper with 10X more data than other tools
File Converter Guides

Convert Multiple HTML Files to PDF: Batch Tools, Chrome Loops and One-File Merging

Convert multiple HTML files to PDF in one go: batch convert free with no upload, loop with Chrome on Windows or Mac, then merge pages in the right order.

convert multiple html files to pdf: LeadCanal guide cover
On this page
  1. Why batch HTML conversion needs a plan
  2. Method 1: Our browser converter, many files at once
  3. Method 2: Headless Chrome on Mac or Linux
  4. Method 3: PowerShell on Windows
  5. Method 4: Python for full control
  6. Method 5: wkhtmltopdf straight into one PDF
  7. How to merge the PDFs into one file
  8. Methods to convert multiple HTML files to PDF compared
  9. Keep the order right
  10. Why privacy matters in a batch
  11. Troubleshooting
  12. A worked example from our team
  13. Frequently asked questions
  14. Conclusion: key takeaways
  15. Editorial policy
  16. Content transparency
  17. About the author

To convert multiple HTML files to PDF, drop them all into a batch converter, download one PDF per page, then merge those PDFs if you need a single document. Our free HTML to PDF converter takes many .html or .htm files at once and saves them one by one or as a ZIP, without uploading anything. For hundreds of files, a short headless Chrome loop on Windows, Mac or Linux does the same job unattended. This guide covers every route, plus how to merge the results in the right order.

Quick answer: Convert first, merge second.

  • Under about 50 files: select them all in the batch HTML converter, set one page size, and download the ZIP.
  • Hundreds of files: loop over the folder with headless Chrome from Terminal or PowerShell.
  • One combined PDF: merge the results in Mac Preview, with qpdf or with a few lines of Python.
  • Name files with leading zeros (01, 02, 03) so they merge in the right order.

Why batch HTML conversion needs a plan

Batches usually come from three places: a website or help center saved for offline reading, a folder of exported reports or invoices, and saved emails or newsletters. Each file is a separate page, often with its own images folder.

Converting them one at a time through a print dialog is slow and easy to get wrong. The steps below keep page size and margins consistent, which matters when the PDFs end up in one document.

Method 1: Our browser converter, many files at once

  1. Open LeadCanal’s HTML to PDF page in any modern browser.
  2. Drop the whole set of .html, .htm or .xhtml files onto the page. Each file is checked by extension and first bytes, so renamed programs are refused.
  3. Choose one page size (A4, Letter or Legal), orientation, margins and layout width for the batch.
  4. Keep remote images off unless the pages pull pictures from the web.
  5. Download each PDF, or download them all together as a ZIP.

The tool produces one PDF per HTML file. To join them, use one of the merge methods further down. Big batches depend only on your device memory, and there is no daily cap or watermark.

Method 2: Headless Chrome on Mac or Linux

Chrome can print any page to PDF from the command line. Run this in Terminal inside the folder of HTML files on a Mac:

for f in *.html; do "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless --print-to-pdf="${f%.html}.pdf" "file://$PWD/$f"; done

On Linux, replace the Chrome path with google-chrome or chromium. Each page becomes a PDF with the same name. Page size follows the page’s own @page CSS, or Letter by default on US systems.

Method 3: PowerShell on Windows

Open PowerShell in the folder and run:

Get-ChildItem *.html | ForEach-Object { & "C:\Program Files\Google\Chrome\Application\chrome.exe" --headless --print-to-pdf="$($_.DirectoryName)\$($_.BaseName).pdf" $_.FullName }

If Chrome is installed elsewhere, adjust the path. Microsoft documents the Get-ChildItem command if you need to include subfolders with -Recurse.

Method 4: Python for full control

Python lets you set page size, wait for scripts and name files exactly. Our sibling guide on how to convert HTML to PDF with Python includes a WeasyPrint folder loop and a Playwright example for JavaScript-heavy pages.

Method 5: wkhtmltopdf straight into one PDF

wkhtmltopdf accepts several input files and writes them into a single PDF in the order given:

wkhtmltopdf 01-intro.html 02-setup.html 03-faq.html manual.pdf

It is the one tool here that converts and merges in a single step. The project is archived and uses an older engine, so modern CSS layouts may render poorly.

How to merge the PDFs into one file

Tool System How
Preview Mac Open the first PDF, show thumbnails, drag the other PDFs into the sidebar, then File, Export as PDF
qpdf Windows, Mac, Linux qpdf --empty --pages *.pdf -- combined.pdf
pypdf (Python) Any Loop over sorted files with PdfWriter().append(), then write()
Adobe Acrobat Windows, Mac Combine Files tool in the paid version

The qpdf manual explains page selection if you only want certain pages from each file. To drop blank or unwanted pages after merging, use the delete PDF pages tool.

Methods to convert multiple HTML files to PDF compared

Method Cost Upload needed Merges into one Best for
LeadCanal batch converter Free No No, ZIP of PDFs Private files, set margins, no install
Headless Chrome loop Free No No Hundreds of files
PowerShell loop Free No No Windows folders
Python scripts Free No Yes, with pypdf Repeat jobs, custom naming
wkhtmltopdf Free No Yes Simple pages, one step
Online batch sites Free or paid Yes Sometimes Public pages only

Keep the order right

  • Rename with leading zeros: 01, 02 up to 10 sort correctly. 1, 2 up to 10 put 10 after 1.
  • Check the sort: list the folder by name before merging.
  • Use one page size: mixed A4 and Letter pages look uneven when printed.

Why privacy matters in a batch

A batch multiplies the risk. Fifty saved invoices or a full export of support tickets can hold hundreds of names and addresses. When you convert multiple HTML files to PDF through an upload site, every one of those files sits on someone else’s server.

Our in-browser converter for .htm and .html files works on your device, so nothing is uploaded or stored. It removes scripts, forms and frames before drawing each page, and keeps remote images off, so saved newsletters cannot send open signals while you convert them.

Troubleshooting

Some PDFs are blank

The page probably needs JavaScript to show content. Use Playwright and wait for the content, or open that file in Chrome and print it by hand.

Images are missing in every file

Saved pages keep images in a separate folder that a browser tool cannot read. Keep the folders beside the files when using Chrome, or switch on remote images in our tool if the images are online.

Pages are cut off on the right

Choose landscape or a narrower layout width for the batch. In Chrome loops, add an @page size to the HTML.

The merged PDF is huge

Image PDFs add up quickly. Compress the final file with the PDF compressor.

A worked example from our team

We clean CSV data and handle client files daily. A client once sent 36 saved HTML pages from their old help center and asked for one PDF manual before the site was switched off.

We renamed the files 01 to 36 in reading order, dropped them into our converter with Letter, portrait and standard margins, and downloaded the ZIP. Remote images stayed off because the old site was already offline, so the screenshots showed their alt text and we flagged the five pages that needed them. We then merged the 36 PDFs with qpdf in one command and removed two blank pages. The finished manual was ready in under 20 minutes, and nothing left our machine.

Frequently asked questions

Can I convert multiple HTML files to PDF at once for free?

Yes. The LeadCanal tool, headless Chrome and the Python libraries are all free.

How do I combine multiple HTML pages into one PDF?

Convert each page to PDF, then merge them with Preview, qpdf or pypdf. wkhtmltopdf can also write several pages straight into one file.

How do I batch convert HTML to PDF on Windows?

Use the PowerShell loop with headless Chrome above, or a browser-based batch tool.

Does the order of files matter when merging?

Yes. Merge tools follow the file name order, so rename files with leading zeros first.

How do I convert a whole folder of saved web pages?

Run a Terminal or PowerShell loop over the folder, or select every .html file in the browser converter.

Can I convert linked HTML pages into one PDF?

Save each linked page as a file first, number them in reading order, then convert and merge.

Why are my batch PDFs different sizes?

Each page sets its own layout. Fix one paper size in the converter or add the same @page rule to every file.

Conclusion: key takeaways

The reliable way to convert multiple HTML files to PDF is to convert with one consistent page size, then merge in a controlled order.

  • A browser batch tool handles dozens of files with no install and no upload.
  • Headless Chrome loops scale to hundreds of files.
  • qpdf, Preview or pypdf merge the results into one PDF.
  • Leading zeros in file names keep pages in order.
  • Keep remote images off for private or saved email pages.

Merging photos instead of pages? See how to combine JPG files into one PDF. On a Mac, our guide on how to convert HTML to PDF on Mac covers single files in Safari and Chrome. You can also browse every free LeadCanal converter.

Editorial policy

We test every command and tool on real batches of files before publishing and revise the guide when software changes.

Content transparency

This guide was researched with keyword data and checked against official documentation from Microsoft, Google and the qpdf project. LeadCanal offers the free tools mentioned in this article.

About the author

The LeadCanal team builds lead lists, cleans CSV and VCF data and handles client files daily, often in batches of hundreds.

Found this useful? Share it with your team.

Written by LeadCanal

The LeadCanal team builds verified B2B lists and runs cold email infrastructure for agencies and sales teams. Every guide comes from campaigns we send every day.

Done-for-you lead generation

Want this done for you?

Targeted lists and cold email campaigns that book qualified meetings.