Pro Calculators and Guides

How to Convert an HTML File to PDF (Invoices, Reports and Pages)

Turn an HTML file you made into a PDF. Includes tips for self-contained pages, images and fonts.

Saizul Amin
Saizul Amin15 Oct 2026 · Updated 17 Oct 2026 · 1 min read
How to Convert an HTML File to PDF (Invoices, Reports and Pages)

If you generate an invoice, a certificate or a report as an HTML page, a PDF is the easiest form to send or print. This tool converts an HTML file into a PDF in your browser.

Quick answer

Add the HTML file and download the PDF. For safety, nothing outside the file (pictures, CSS or fonts from other websites) is fetched, so keep pictures and styles inside the file.

Make the file self-contained

  • Put CSS inside a <style> block rather than linking to an external stylesheet.
  • Embed images as Base64 data URIs, or keep them small.
  • Use system fonts (Arial, Times New Roman, a Bangla Unicode font installed on your machine) or embed what you need.
  • Avoid scripts; they are not executed.

Steps

  1. Prepare the HTML with styles inside.
  2. Open the tool and choose the file.
  3. Convert and download the PDF.
  4. Check page breaks and images.

Layout tips

  • Set a page width that fits A4 (about 700 to 800 px).
  • Use page-break-before or break-inside: avoid to control where pages split.
  • Use simple tables for invoices, not complex flexbox layouts.
  • Keep margins in the CSS so text does not touch the edge.

Why fetching is blocked

If the converter downloaded remote content, a crafted file could read internal resources. Blocking external fetches keeps the tool safe and keeps your document private.

Alternatives

For a live web page, use your browser's print-to-PDF; for plain text use Text to PDF.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages