How to Convert HTML to PDF

By UpnixTools · Updated October 25, 2026 · 5 min read

Skip the reading — try it now
Free · No signup · Works in your browser
Open HTML to PDF →

HTML is how content lives on the web, but PDF is how content gets shared, filed, printed, and signed. Invoices, reports, receipts, tickets, and articles all become far more useful once they are PDFs: they look the same on every device, they print predictably, and they cannot be accidentally edited by the reader. Converting HTML to PDF is straightforward, but the difference between a clean document and a messy one comes down to a few settings, page size, margins, page breaks, and print styling, that are easy to get right once you know they exist.

This guide covers the practical workflow: how to convert a page or a block of HTML, how to choose settings for documents versus wide layouts, and how to fix the problems that appear most often, such as cut-off tables, missing backgrounds, and awkward page breaks.

What HTML to PDF is good for

In each case the goal is the same: freeze a web page into a stable, portable document. If the content still needs editing, keep the HTML as the source and generate a fresh PDF whenever it changes, rather than editing the PDF itself.

Step by step: convert HTML to PDF

  1. Open the HTML to PDF tool in your browser.
  2. Provide the HTML. Paste your HTML code, or enter the page you want to convert, depending on what the tool supports.
  3. Choose page size and orientation. A4 portrait is the default for documents; landscape suits wide tables.
  4. Set margins. Modest margins keep content away from the unprintable edge of printers and make the document easier to read.
  5. Preview the result. Check the first page, the last page, and any page with a table or image.
  6. Download the PDF and give it a clear file name with a date, so it is easy to find later.

Always preview before sharing. A PDF that looks fine on the first page can still have a table split across pages or an image pushed onto a blank page further down, and those problems are much easier to fix before the file is sent.

Choosing page size, orientation, and margins

Document typeRecommended setting
Invoices, letters, reportsA4 portrait, normal margins
US submissionsLetter portrait, if specified
Wide tables, dashboardsA4 or Letter landscape
Posters and certificatesLandscape, narrow margins

When in doubt, choose A4 portrait with normal margins. It prints well almost everywhere, reads well on screen, and matches what most recipients expect. Landscape is a specialist choice: it rescues wide tables that would otherwise shrink to unreadable size in portrait, but it looks odd for ordinary text documents.

Print styling: why pages and screens differ

A web page is designed for a scrolling screen, while a PDF is designed for fixed pages. That difference explains most conversion surprises. Navigation bars, sidebars, and buttons that make sense on screen have no place in a printed document, and many sites hide them automatically in print using print styles. Background colours and images are also often switched off in print by default, because they use ink without adding information.

If your PDF is missing colours, check whether background graphics are enabled in the print settings. If navigation or buttons appear in the PDF, they were not hidden by print styles, and you may need a cleaner source version of the content. If a page looks perfect on screen but breaks badly in the PDF, the problem is usually width: an element wider than the page forces the layout to overflow or shrink, and reducing wide tables, images, and fixed-width blocks fixes it.

Fixing common HTML to PDF problems

Work through the preview page by page rather than trusting the first page. Most problems are visible in seconds once you look for them, and fixing them at the HTML stage is always easier than editing a finished PDF.

HTML to PDF vs printing from the browser

Every desktop browser can already print a page to PDF, and for a quick one-off copy that is often enough. A dedicated converter earns its place when you need consistent settings, repeated conversions, or a clean result from raw HTML rather than a live page. Browser printing is convenient; a converter gives you control over the input, the page setup, and the output in one place. Use the browser for a fast copy, and use a converter when the PDF is going to a client, an archive, or print.

Bottom line: start from clean HTML, choose A4 portrait unless a wide layout demands landscape, set sensible margins, preview every page, and fix width and print-styling problems in the source before you share the PDF.

Frequently Asked Questions

Is it free to convert HTML to PDF online?

Yes. UpnixTools HTML to PDF converter is free with no account or signup. Paste your HTML or enter a page, set your page options, and download the PDF.

Will my PDF look exactly like the web page?

Usually close, but not always identical. Print styling, page breaks, and background colours are handled differently in print, so always preview the PDF and adjust margins, page size, and print settings if something shifts.

What page size should I choose for a PDF?

A4 portrait is the safe default for documents, invoices, and reports. Use Letter for US submissions that specify it, and landscape for wide tables and dashboards that would otherwise be squeezed.

Why do parts of my page go missing in the PDF?

The most common causes are content hidden by print styles, elements wider than the page, and background graphics switched off in print settings. Check the print preview, reduce wide elements, and enable background graphics if colours are missing.

Can I convert HTML to PDF on a phone?

Yes. Open the converter in your mobile browser, paste the HTML, and download the PDF to your device. For complex layouts, a desktop browser usually gives a more accurate preview.

Ready to try it yourself?
HTML to PDF is free forever — no account needed.
Open HTML to PDF →