Paste HTML below and this converter typesets it into a real PDF entirely in your browser: html-to-pdfmake (MIT) translates your markup into pdfmake's layout model, and pdfmake (MIT) writes the file — US Letter is 612 × 792 points with a 532 pt text column at default margins. Headings, lists, tables, links, and images carry over; it's a clean-print converter, not a browser clone, so CSS layout doesn't apply. Nothing is uploaded.

Convert HTML to PDF

Advertisement

What Converts, Tag by Tag

HTMLBecomes in the PDFNotes
<h1>–<h6>Styled headingsSized and bolded from the style map
<p>ParagraphWrapped and justified to the column
<strong>, <b>, <em>, <i>Bold / italicNested inline styles combine
<ul>, <ol>, <li>Bulleted / numbered listsNesting indents
<table>, <tr>, <td>, <th>PDF tablecolspan/rowspan respected; borders drawn
<a href>Clickable linkReal PDF link annotation
<img src="data:…">Embedded imageData URIs only — remote URLs aren't fetched
<blockquote>Indented quoteLeft margin block
<hr>Horizontal ruleFull column width
<div>, <span>Transparent containersStructure only — no CSS box model

A small set of inline styles (color, background, bold, text alignment, font size) is honored. Stylesheets, class definitions, positioning, and fonts from CSS are not — that's a layout engine, not a converter.

How It Works

Browsers render HTML through millions of lines of layout engine code. A PDF converter that isn't a browser has to choose which slice of that to reimplement. This one converts structure into pdfmake's declarative layout — the same "content flows into a column" model Word uses — and lets pdfmake handle pagination, tables, and typography.

The chain

Your pasted markup is parsed with the browser's own DOM parser. html-to-pdfmake (MIT, by Aymeric) walks the resulting tree and emits pdfmake content objects: headings become styled text, tables become table layouts with auto-sized columns, links become PDF annotations. pdfmake (MIT) then measures every line, breaks pages where the column overflows, and writes the PDF byte by byte in your tab.

How to use it

Paste HTML — a full document or a fragment, both work — pick a page size and base font, and convert. The stats row shows what the parser found and the page count of the finished PDF, read from the PDF's own page tree. If a table is cramped, switch to landscape or drop the base font a point; those two knobs fix most layout complaints.

A worked example with real numbers

Take the sample report preloaded above: a heading, a paragraph, a 4-row table, and a closing line. On US Letter — 612 × 792 pt — with the default 40 pt margins, the text column is 612 − 80 = 532 pt wide and 792 − 80 = 712 pt tall. At the 11 pt base size with 1.25 line spacing, each line is 13.75 pt, so a page holds about 712 ÷ 13.75 ≈ 51 lines. The sample needs fewer than 15, so it fits on one page with room to spare; the three-column table auto-sizes to roughly 177 pt per column. Multiply that to a 40-row invoice and you're at ~44 rows plus headers — call it 2 pages, with the row splitting across the break handled by pdfmake.

Unit translation, since it comes up constantly: PDFs think in points (1 pt = 1/72 in), browsers in pixels (96 per inch). One CSS pixel is 0.75 pt — a 16 px web font is 12 pt in PDF terms, which is why screen-size text often looks small on paper and why the base-size selector matters.

Frequently Asked Questions

Can this tool convert any web page to PDF?

It converts HTML content, not live web pages. Paste the markup (or an email template, a documentation snippet, a generated report) and it typesets it. It doesn't fetch remote pages by URL, load external stylesheets, or run JavaScript — which is exactly why it's safe to point at untrusted markup. For archiving a whole page as it appears, your browser's own Print → Save as PDF does that job better.

Is my HTML rendered exactly as in the browser?

No, and any tool that claims otherwise from pasted HTML is lying to you. This is a clean-print converter: it maps HTML structure — headings, paragraphs, lists, tables, links, images, bold and italic — into PDF typography. It does not implement the CSS layout engine, so flexbox grids, absolute positioning, web fonts, and animations don't carry over. For articles, tables, and invoices that structure is what matters.

Do links and images survive the conversion?

Links stay clickable — an <a href> becomes a real PDF link annotation. Images need to be embedded as data URIs (base64), because pdfmake builds the file in memory and does not fetch remote URLs; a <img src="https://…"> will fail, so convert remote images to data URIs first. Relative paths like /img/logo.png have nothing to resolve against and won't work either.

What does the tool do with CSS?

It reads a practical subset of inline styles — color, background color, bold, font size, text alignment — and ignores the rest. External stylesheets and <style> blocks are not applied, because implementing CSS cascade is a browser's job. Design in the HTML's structure and let the PDF typography settings (page size, margins, base font size) handle the presentation.

Why would I use this instead of the browser's Print dialog?

Control and repeatability. Print → Save as PDF bakes in whatever the page happened to look like, including ads, cookie banners, and responsive mobile layout. This converter typesets the content itself at the page size and margins you choose, the same way every time — which is what you want for invoices, receipts, reports, and templated documents that get regenerated.

How big can the HTML be?

The parser and layout engine run in your tab, so the ceiling is memory — comfortably tens of thousands of words and hundreds of table rows, which covers any document you'd actually paste. Since nothing uploads, there's no server-side size cap or rate limit at all.

Advertisement