Filezaro
Document tools

How to Convert HTML to PDF: A Practical Guide

Turn HTML code or an .html file into a PDF. Learn which CSS works, why external images do not load and how to design printable pages.

By Filezaro Team4 min read

HTML is how most invoices, certificates, reports and email templates are designed. But you cannot send someone raw HTML and expect a good result: it changes with the browser, the screen size and the fonts installed. A PDF freezes the design into a fixed, printable page. This guide shows how to convert HTML into PDF and explains why some things, like external images, behave differently here than in your browser.

What the converter does

Your HTML is loaded in a real browser engine running on our servers, then printed to PDF using the page size, orientation and margins you choose. Inline styles and style blocks are applied, so what you designed is what you get.

How to convert HTML to PDF

HTML to PDF — free online tool

Render HTML as a PDF. No sign-up needed.

Open HTML to PDF
  1. Open the HTML to PDF tool.
  2. Upload an .html file, or paste your HTML.
  3. Choose the page size, orientation and margin.
  4. Decide whether to print background colours and images.
  5. Tick Add page numbers if needed.
  6. Press Create PDF and download.

What works, and what does not

The conversion runs in a locked-down browser. This protects our servers and your data, and it affects what can appear on the page.

FeatureSupported?
Inline CSS and style blocksYes
Tables, lists, headings, bordersYes
Background coloursYes, when you tick the option
Images embedded as data URLsYes
Images or CSS loaded from the internetNo (blocked for security)
Web fonts from the internetNo; common system fonts are used
JavaScriptNo (switched off)

Making your HTML print-friendly

  1. Put all CSS in the page. Use a style block in the head instead of linked stylesheets.
  2. Embed images. Convert pictures to data URLs (base64) so they travel inside the HTML.
  3. Use common fonts. Arial, Georgia, Times New Roman, Courier New and similar are safe.
  4. Think in pages, not screens. Use percentage or millimetre widths instead of fixed pixel layouts that assume a screen.
  5. Control page breaks with the CSS properties for page-break-before and page-break-inside to avoid a table row being cut in half.
  6. Use high contrast. Light text on a dark background uses a lot of ink if printed, and may not show if background printing is off.

Browsers normally skip background colours when printing to save ink. If your design uses coloured headers or shaded table rows, tick Print background colours and images. If you simply want a plain, ink-friendly document, leave it off.

Common uses

  • Invoices and receipts generated by your own system.
  • Certificates and tickets designed in HTML.
  • Reports from templates.
  • Email templates saved as documents.
  • Documentation exported from static site tools.

Why can't I convert a live URL?

Loading arbitrary web addresses from our servers would be a security risk, so the converter works with the HTML you give it. To convert a page you can see in your browser, save it as an HTML file (and embed its images if you need them), or copy the relevant code.

Real-world examples

A developer generates invoices. The billing system produces an HTML invoice for each customer. For a quick test, the developer pastes one into the tool to see how the page breaks and margins look as a PDF before building automation.

A teacher designs a certificate. A certificate template with a coloured border is saved as HTML with inline CSS. With background printing switched on, the border and colours appear exactly as designed.

A marketer archives an email. The HTML of a newsletter is saved and converted so that a fixed copy of the campaign can be stored with the project files.

Mistakes to avoid

  1. Linking stylesheets and images. Anything loaded from the internet is blocked. Inline your CSS and embed images.
  2. Relying on JavaScript to build the page. Scripts do not run, so the HTML must already contain the final content.
  3. Using fixed pixel widths larger than the page. Content may be cut off. Use percentages or millimetres.
  4. Forgetting to turn on background printing. Coloured headers and shaded rows disappear when it is off.
  5. Ignoring page breaks. Use CSS page-break rules so a table row or heading is not split across two pages.

Quick checklist

  • All CSS is inside the file
  • Images are embedded as data URLs
  • Fonts are common system fonts
  • Page size and margins match the intended print
  • Background printing is on if your design needs colour

Free limits

  • 3 uses per tool every 24 hours on the free plan, with or without an account (Pro is unlimited).
  • Files up to 10 MB each on the free plan; Pro allows larger files.

Final thoughts

HTML to PDF gives you full design control with a fixed, shareable result. Keep your CSS inline, embed your images and choose backgrounds on or off. Convert your HTML now, or try the simpler Markdown to PDF guide if you prefer writing in plain text.

Frequently asked questions

Why are my external images and fonts missing?

For security the converter loads nothing from the internet. Embed images as data URLs and keep your CSS inline or in a style block.

Does JavaScript run in the page?

No. JavaScript is switched off so untrusted pages cannot do anything unexpected.

Can I convert a live web page?

Not directly. Save the page as an HTML file or paste its code, then convert that.

Try HTML to PDF now

Render HTML as a PDF. Free, private and no sign-up needed.

Open HTML to PDF
Document tools4 min read

How to Convert Markdown to a Beautiful PDF

Turn Markdown notes, READMEs and documentation into a clean PDF with headings, tables, code blocks and task lists. Includes Markdown syntax basics.

Document tools4 min read

How to Convert a Text File to PDF (Any Language)

Turn plain text into a clean, printable PDF. Choose fonts, page size and margins, add page numbers and use any language, including right-to-left scripts.

Document tools4 min read

How to Convert a Word Document (DOCX) to PDF

Turn a Word document into a PDF that looks the same everywhere. Learn about fonts, page size, margins and the best practices for CVs and contracts.