HTML to PDF

Paste HTML, get an A4 PDF of how it renders.

Runs in your browser. Nothing is uploaded — your input is processed on this device and discarded when you close the tab.

Your files

This tool takes an HTML snippet — a formatted announcement, a simple invoice layout, a styled table, a piece of documentation — renders it the way a browser would draw it, and turns that rendering into an A4 PDF. It is for quick, visual jobs: freezing a styled fragment into a file you can email, archiving how a component looks, or producing a simple printable handout from markup you already have.

Read this part before you rely on it: the PDF is a picture of the rendered HTML, not a text document. Each page holds a rendered image of your content, so the words cannot be selected, searched or copied out of the file, links are not clickable, and the result is an approximation of the on-screen render rather than a print-perfect reproduction. For many sharing jobs that trade is fine; for contracts and accessible documents it is not, and a real document editor is the right tool there.

How to use HTML to PDF

  1. Paste or type your HTML. Put the snippet in the editor box. A fragment is fine — you do not need the html and body tags around it.
  2. Preview it. Choose Preview to see the sanitised render. If something vanished, it was probably a script, an embedded frame or external content the sanitiser removed on purpose.
  3. Check the length. Content taller than one A4 page is sliced into further pages at exact page-height boundaries; the Limitations section explains what that means for lines of text near a break.
  4. Build the PDF. Choose Build PDF. The snippet is rendered at double scale for sharpness, sliced into A4 pages, and assembled into a single file.
  5. Download and inspect every page break. Open the result and look specifically where pages join. If a break cuts through something important, adjust your markup — add spacing or shorten a section — and build again.
  6. Iterate freely. Nothing is uploaded and no state is kept, so editing the snippet and rebuilding costs nothing.

Features

Worked example

Suppose your snippet renders to a block 794 pixels wide — the width of A4 at 96 CSS pixels per inch — and 2,000 pixels tall. One A4 page at that width is 1,123 pixels tall, so the planner cuts the render into two slices: the first 1,123 pixels and the remaining 877. The PDF gets two pages: page 1 filled edge to edge by the first slice, and page 2 showing the 877-pixel remainder scaled to the page width with white space below it. If the total height were exactly 2,246 pixels, the result would be two completely full pages with no remainder. These slice numbers are asserted by the tool's automated tests, as is the assembly of a real two-page A4 PDF from test images.

Common errors and limitations

Frequently asked questions

Is the text in the resulting PDF selectable?

No, and this page will not pretend otherwise. The PDF contains a picture of your rendered HTML on each page, so text cannot be selected, searched or copied. If you need a text-based PDF, build the document in an editor and export it from there.

What happens to scripts in my HTML?

They are removed before anything renders. Script, iframe, object, embed and form tags are stripped entirely, inline event-handler attributes are removed, and javascript: links are neutralised, so pasted markup — including a hostile snippet — stays inert.

Why did a long page get cut through a line of text?

The rendered page is one tall picture that is sliced at exact A4-height boundaries. A line or image straddling a boundary is cut in two. Shorten the content, or add page-sized spacing in your HTML where you want the breaks to fall.

Can I convert a whole website by pasting its address?

No. This tool converts an HTML snippet you paste or type here. It does not fetch web pages, and external stylesheets, fonts and images referenced by a full page will usually be missing from the render.

Is my HTML sent to a server?

No. Sanitising, rendering and PDF assembly all happen in your browser. The snippet you paste never leaves your device.

Related PDF tools

PDF to Markdown

Convert a PDF's text layer to Markdown — headings from type size, lists from markers, paragraphs from gaps — entirely in your browser.

Image, PDF and Documents

JPG to PDF

Combine up to 10 PNG, JPEG or WebP images into a single PDF with fit, A4 or Letter pages — built entirely in your browser.

Image, PDF and Documents

PDF to JPG

Turn each page of a PDF into a numbered JPG at your choice of DPI and quality — rendered entirely in your browser, zipped when there are several.

Image, PDF and Documents

Scan to PDF

Assemble up to 10 scanned or photographed pages into one PDF, with per-page rotation and a document-cleaning enhancement — all in your browser.

Image, PDF and Documents

Prefer everything on one page? The original PDF Toolkit merges, splits and rearranges with one shared file list. The full suite is indexed on the PDF Tools hub.