HTML to PDF

Paste HTML or drop in a file, set the page size and margins, and get a PDF. There are two ways out and they are genuinely different, so both are offered rather than one being chosen for you. Download renders the page to an image and lays it into the PDF: it matches the preview exactly, and the text is a picture — you cannot search or select it, and the file is bigger. Print to PDF goes through your browser's own print engine and keeps real, selectable text, but the browser decides some of the layout. Use print unless you specifically need pixel-exact output. Pasted markup is sanitised before it is rendered, because injecting arbitrary HTML into this page unsanitised would be a security hole, and scripts cannot run in a PDF regardless.

Choosing an output

DownloadPrint to PDF
Matches preview exactlyYesMostly
Text selectable and searchableNoYes
Works with screen readersNoYes
File sizeLargerSmaller
You control marginsYesBrowser dialog does

When to use it

  1. Turn an HTML invoice or report into a PDF.
  2. Convert an email template into a shareable document.
  3. Export a styled table as a printable page.
  4. Generate a PDF from HTML without installing anything.
  5. Check how markup will paginate at A4.

How to Use

  1. Paste your HTML, or drop in an .html file.
  2. Set the page size, margins and orientation.
  3. Choose Print to PDF for real text, or Download for an exact match.

Features

  1. Paste or upload HTML
  2. A4, Letter, Legal, A3 and A5, portrait or landscape
  3. Margin presets
  4. Live preview at the chosen margins
  5. Two output routes with the trade-off explained
  6. Sanitised rendering, entirely client-side

FAQs

Is my HTML uploaded?

No. Rendering happens in your browser and nothing is transmitted.

Which output should I choose?

Print to PDF for almost everything — it keeps real text, so the result is searchable, selectable and accessible to screen readers, and the file is much smaller. Choose Download only when you need the output to match the preview pixel for pixel and are willing to give up the text.

Why is the text not selectable in the downloaded file?

Because that path rasterises the page: the PDF contains an image of your content, not text. That is what makes it match the preview exactly. The print route keeps real text if you need it.

Will my CSS work?

Most of it. Layout, colours, borders, tables and web fonts generally render. Anything depending on JavaScript will not, since scripts are stripped and could not run in a PDF anyway. Fixed positioning and viewport units behave oddly, because a page is not a viewport.

Why were parts of my HTML removed?

Scripts, iframes and embedded objects are stripped before rendering. They cannot appear in a PDF, and rendering unsanitised HTML inside this page would let pasted markup run code in your browser.

Can content span multiple pages?

Yes. Long content is split across as many pages as it needs, each taking its own slice rather than repeating the whole thing, which keeps the file size sensible.

Technical Details

Two routes are offered because they trade different things, and a tool that hides that choice picks the wrong one for half its users. The download path lays the HTML out off-screen at exactly the page's content width — so the line breaks in the PDF are the ones that width actually produces — rasterises it with html2canvas, and slices the resulting bitmap across pages with jsPDF. It matches the preview exactly and the text is a picture: unsearchable, unselectable, and larger on disk. The print path hands the content to the browser's own print engine, which produces real text and real fonts, at the cost of the browser deciding the margins and page breaks. Each page takes its own slice of the tall canvas rather than the whole image offset upward, which is what stops a long document embedding the entire bitmap once per page and producing a file many times larger than it should be. Pasted HTML is untrusted input being rendered into this page's own DOM, so it is run through DOMPurify with scripts and frames removed before it reaches the preview — a tool that injects arbitrary HTML into itself unsanitised is a self-XSS, and the removed elements could not have rendered into a PDF anyway. Everything runs locally; no markup is uploaded.

From the Blog

  • Word to PDF Converter — Free, Fast & Private

PDF Tools

PDF Tools

  • Word to PDF
  • Password Protect PDF
  • PDF Password Remover
  • PDF Page Organiser
  • Add Page Numbers to PDF
  • Sign PDF
  • Image to PDF
  • Compress PDF to Target Size