Convert HTML to PDF

Open HTML to PDF, drop the .html file on the page, and download the PDF after it is checked. The conversion runs in this browser tab: the markup is stripped of scripts and remote references, laid out at the width of the PDF text column, and drawn as selectable text. The finished file is reopened and its text counted before you get it.

HTML to PDF

How to convert an HTML file to PDF

  1. Choose the file

    Open HTML to PDF and drop an .html or .htm file on the page, or pick one. It is read in this browser tab and never uploaded.

  2. Read the receipt

    Before rendering, the tool removes scripts, frames, embedded objects, stylesheet links, remote references and event handlers, and counts every removal by kind. The receipt tells you what the PDF will not contain.

  3. Check the layout

    The page is laid out in a sandboxed frame at the width of the PDF text column, so headings, lists, tables and quotes land the way the PDF will show them.

  4. Download the checked PDF

    The tool reopens the PDF it wrote with a separate reader and counts the text. At least 98 percent of the non-space characters must come back, or there is no download.

Width decides everything

An HTML document describes content and rules, not fixed pages. The same file is one column on a phone and three on a monitor, so the first real decision in any conversion from HTML to PDF is the width the layout is measured at. This tool mounts the markup in a sandboxed frame set to the exact width of the PDF text column and lets the browser's own layout engine do the measuring. What you get is the document as the browser would flow it at that width, paginated, with nothing rasterized.

That is also why the result can differ from what the page looked like on your screen: your screen was a different width, and possibly a different stylesheet. The PDF is the file's own markup at the PDF's own width.

What is stripped, and why that is the point

Before the markup is rendered, the tool removes every script, frame, embedded object, media element, stylesheet link, base tag, meta refresh, event handler and javascript: address, and rewrites out @import and remote url() references. Each removal is counted on the receipt by kind, so a stripped page is never a silent surprise.

This is not a limitation to apologize for. A saved page carries live code and calls to remote servers, and running either during a conversion would mean executing an untrusted program and telling other machines what you are converting. Stripping first means the conversion cannot phone anywhere, and the receipt means you know exactly what was taken out. A page that leaned on a remote stylesheet converts as plain markup, which the receipt will have told you before you look.

What carries over

Structure survives. Headings keep their levels, lists keep their markers and nesting, tables keep merged cells, padding, borders and shading, block quotes stay quotes, preformatted text keeps its spacing, and rules, alignment, indents and line heights come through. To turn an HTML document into a PDF without flattening it into a picture is the whole job, and every character in the output stays selectable.

Footnotes get their own care. Markers written as doc-noteref, as epub noteref, or as plain superscript links are recognized, and each note's text is set at the foot of the page that cites it, the way a typeset document does it, with the original end-of-file note list consumed so nothing prints twice.

Images split by where they live. Pictures embedded in the file itself are carried into the PDF, PNG and JPEG byte for byte, other formats redrawn, and inline SVG rendered at three times its size so it stays sharp. Pictures that live at a web address are counted as dropped, because fetching them would mean talking to a server. Save the page as Webpage, Complete if the images matter, and read Save a webpage as HTML for that step.

What the tool refuses

Drop a bare link, a .webloc or a .url shortcut on the tool and it refuses with its reason: that is a pointer to a page, not the page, and fetching it needs a server this site does not use. The honest input is a saved file. A page that only exists after its scripts run converts as whatever markup the file holds, because the scripts are removed, not executed; save the page after it has finished loading and the file holds more.

If you only want a quick snapshot of a page you are reading, skip the tool entirely and print: Save a webpage as a PDF covers the two-key route and when it is enough.

The check before the download

Turning markup into fixed pages is exactly the kind of conversion where text quietly goes missing, so this one proves itself. The finished PDF is reopened with a second, independent reader, and its text is compared with what went in. At least 98 percent of the non-space characters must come back, or the tool shows the failure instead of the download. When you need the way back, from PDF to markup, How to convert PDF to HTML covers the reverse trip and its own check.

Questions people ask

How do I convert an HTML file to PDF for free?
Drop the file on HTML to PDF. It converts in your browser tab, nothing is uploaded, there is no account and no watermark, and the PDF is checked against the source before you can download it.
Why does the PDF look plainer than the page did in my browser?
The page probably loaded its styling from a remote stylesheet, and remote references are stripped rather than fetched. The receipt counts what was removed. Save the page as Webpage, Complete to keep more of it in the file.
Can I turn a web address into a PDF with this tool?
No. It takes a saved file and refuses links, because fetching a page needs a server and this tool sends nothing to one. Save the page as HTML in your browser, then convert that file.
Does converting HTML to PDF keep tables and footnotes?
Yes. Tables keep merged cells, borders and shading. Footnote markers are recognized in three notations and each note is set at the foot of the page that cites it.
Is the text in the finished PDF selectable?
All of it. Nothing is rasterized, every character is drawn as text, and the verification that runs before the download reads that text back out of the PDF.
What happens to the JavaScript in my saved page?
It is removed before rendering and counted on the receipt. Scripts never run during a conversion, so a page built entirely by its scripts converts as the markup the file actually holds.

Do it now

The tool runs in this browser. Your file never leaves the machine, and the result is checked before you download it.

HTML to PDF

Where to go next