Skip to content
PDFMergely
Merge PDFs

Convert an HTML file to a PDF

The file on your disk, rendered properly and paginated without cutting lines in half.

Files never leave your device · No upload · Free
Loading tool…

An HTML file is the output of half the tools in the world: exported reports, generated documentation, saved messages, test results. Turning one into a PDF usually means opening it and printing, which gives you whatever the browser print stylesheet decided. This renders it with your page settings, breaks pages so that lines, images and table rows stay whole, and keeps the text searchable.

How to convert an HTML file to a PDF

  1. 1

    Add the HTML file

    Drop in the .html file. If it refers to images or stylesheets in a folder, add those too so it renders as intended.

  2. 2

    Set the page up

    Paper size, orientation and margins. Desktop layout is worth turning on for anything designed for a wide screen.

  3. 3

    Download the PDF

    The text stays real text and links stay clickable. For fully vector output, use Print to PDF instead.

Why not just print it

Printing from a browser applies the page own print rules, which is why half the content vanishes or the sidebar is printed and the article is not. Converting it here gives you control of the paper, the margins and where the breaks fall.

Frequently asked questions

Do scripts run?+

No. Scripts are removed before rendering, which is both safer and more predictable. What you get is the page as written, not as a script rewrote it.

What about external stylesheets and fonts?+

Nothing is fetched from the internet. Local files you add are used; anything that would have loaded from a remote server falls back to defaults.

How are page breaks decided?+

Breaks are placed so a line of text, an image or a table row is never split across pages, which is the usual complaint about printing from a browser.

Is my file uploaded?+

No. Rendering and PDF generation both happen in your browser.

Related tools