Skip to main content

Convert an HTML File to PDF

To convert an HTML file to PDF, upload your .html or .htm file, choose PDF and convert. The page is rendered by headless Chromium in print mode, honouring your @page rules; without them it uses A4 with 10 mm margins. For security, scripts are not run and external files such as linked CSS, remote images and web fonts are not loaded. Web page URLs cannot be entered.

  • Free, no sign-up
  • Files deleted within 30 minutes
  • Up to 100 MB

Files are permanently deleted from our servers within 30 minutes.

How to convert HTML to PDF

  1. Upload your HTML file

    Drag your HTML file onto the upload area or browse for it (up to 100 MB).

  2. Keep PDF as the target

    PDF is already selected in the menu; you can pick another format if you need one.

  3. Convert and download

    Press “Convert” and the download of the converted file starts automatically.

What is preserved?

Kept

  • Inline styles and the first <style> block
  • Page size and margins set with @page
  • Background colours and data: URI images
  • Tables, lists and CSS page-break rules

Changed

  • Without @page, pages are A4 with 10 mm margins
  • Web fonts are replaced by similar fonts installed on the server

Not carried over

  • Linked stylesheets and remote (http/https) images
  • Content drawn by JavaScript (charts, dynamic tables)
  • Additional <style> blocks in <head> after the first

When to use it

Invoices and reports generated as HTML

If your app or script produces invoices, reports or certificates as HTML, embed the CSS in the file and convert it to a print-ready PDF. Control page size and margins yourself with an @page rule.

Archiving self-contained HTML documents

Single-file HTML documents that carry their own styles and images, such as exported notes or email templates, can be kept and shared as PDFs that look the same on every device.

Limitations to know

  • No URL input: this is not a webpage-to-PDF tool; upload a saved .html or .htm file.
  • Images referenced by relative paths (e.g. images/logo.png) cannot be found, because only one file is uploaded.
  • No header, footer or page numbers are added to the PDF.

About the formats

What is HTML?

HTML (HyperText Markup Language) is the markup language web pages are written in. Headings, paragraphs, lists, tables, links and images are defined with tags, and CSS controls how they look. An .html file opens in any web browser without extra software and reflows to the screen width instead of using fixed pages. External stylesheets, web fonts and remote images are separate resources and do not travel with the file unless they are embedded in it.

What is PDF?

PDF (Portable Document Format) is a fixed-layout document format created by Adobe and standardised as ISO 32000. Every piece of text, image and line is stored with its position on the page, so a PDF looks the same on every device and prints reliably. The trade-off is editing: a PDF stores positions on a page, not paragraphs and tables. Scanned PDFs contain only page images and need OCR before any text can be extracted.

Frequently asked questions

Can I paste a website URL to get a PDF?

No. This converter only accepts .html files you upload. To save a live web page as PDF, open it in your browser, choose Print and select Save as PDF as the destination. If you have the page's HTML file, embed its styles in the file and upload it here.

Why are images or styles missing from my PDF?

For security the renderer never connects to external resources: linked .css files, images hosted online and web fonts are not loaded, and JavaScript does not run. For a faithful PDF, move your CSS into a <style> block and embed images as data: URIs (base64) inside the HTML file.

How do I set the page size or margins?

Add an @page rule to the <style> block in your HTML, for example @page { size: A4 landscape; margin: 20mm; }. The converter gives CSS page size priority. Without an @page rule, it uses portrait A4 pages with a 10 mm margin on every side.

Is converting HTML to PDF free?

Yes, completely free. There is no account, subscription or watermark — just upload your file and convert it.

Is my file safe and when is it deleted?

Your file is transferred over HTTPS and stored on our server under a random code. The upload and the output are permanently deleted within 30 minutes, and the download link only works for whoever holds your unique code.