Skip to main content
PDF Tools

HTML to PDF

Convert raw HTML or a web-page URL to a print-ready PDF — entirely in your browser. Nothing is uploaded.

No upload — your files never leave your device

  • 100% private
  • Runs in your browser
  • Works offline
  • No sign-up

Scripts, inline event handlers and javascript: URLs are stripped before rendering — safe to paste markup from anywhere.

Select an HTML file

or drop files here

Its markup is loaded into the editor above

.HTML, .HTM, TEXT/HTMLMax 10 MB

About HTML to PDF

HTML to PDF renders raw HTML markup — or a fetchable web-page URL — into a print-ready PDF. Paste markup straight in (there's a sample invoice to try), load a .html file, or point it at a URL, then pick A4 or Letter and portrait or landscape. Scripts and inline event handlers are stripped before rendering, so it's safe to paste markup from anywhere, and the conversion happens entirely in your browser.

  • No uploads
  • Browser-only
  • Works offline
  • 100% free

How it works

  1. 1

    Provide the HTML

    Paste markup into the editor, load a .html file, or switch to the URL tab and enter a full https address for the tool to fetch.

  2. 2

    Set the page options

    Choose paper size (A4 or Letter) and orientation (portrait or landscape) to control how the rendered page is laid out.

  3. 3

    Convert and download

    Click ‘Convert to PDF’. The sanitised HTML is rendered to a PDF locally and downloaded — named after the URL host in URL mode.

Paste HTML or fetch a URL — pick the mode that will actually work

The tool offers two routes to the same PDF, and choosing correctly avoids the most common frustration: a URL that simply won't load. The rule is about who is allowed to read the page. Your browser can always render markup you paste in, but it can only fetch a remote URL when that site permits cross-origin (CORS) access — which many public sites deliberately block.

Your situationBest modeWhy
You have the HTML (invoice, receipt, template)Paste HTMLRenders directly; no network needed
A public page that blocks CORSPaste HTML (copy View Source)The fetch would be refused by the site
A same-origin or CORS-enabled URLFrom URLThe browser is allowed to read it
A page behind a loginPaste HTMLThe fetch has no access to your session

Scripts, inline event handlers and javascript: URLs are stripped before rendering in both modes, so pasting markup from anywhere is safe. The tool never fabricates a page it couldn't actually read.

HTML to PDF versus your browser's Print to PDF

Your browser's own Print → Save as PDF is the right tool for snapshotting a live page exactly as it renders — scripts run, your login state applies, and lazy-loaded content appears. This tool is built for the opposite need: turning HTML you control into a clean, repeatable document with fixed A4 or Letter paper and a chosen orientation, entirely offline and without uploading anything. Reach for it when you're generating invoices, receipts or reports from markup — often paired with Word to PDF or Markdown converted via Markdown to HTML — and use Print to PDF when you just need a faithful capture of a page as it appears in front of you. Once generated, Merge PDF can bundle several of these documents into one.

Frequently asked questions about HTML to PDF

  • Why does fetching a URL sometimes fail?

    Browsers can only read pages that permit cross-origin access (CORS). Many public sites block this, so a fetch may be refused. When that happens, open the page yourself, copy its HTML (View Source), and paste it into the Paste HTML tab instead — the tool never fabricates a page it couldn't actually read.

  • Is it safe to paste HTML I copied from a website?

    Yes. Before rendering, the tool strips out scripts, inline event handlers and javascript: URLs, so pasted markup can't execute anything. You get the visual document without the active code that came with it.

  • Will external CSS, fonts and images render?

    Assets the page can load render, but anything blocked by CORS or hosted behind authentication may not appear. For the most predictable output, inline your styles and use absolute image URLs, or paste a self-contained HTML document.

  • How is this different from ‘Print to PDF’ in my browser?

    Print-to-PDF captures a fully-rendered live page including its scripts and login state; this tool converts standalone or sanitised markup with fixed paper and orientation settings, entirely offline. It's built for generating documents from HTML you control — invoices, receipts, reports — rather than snapshotting an arbitrary live site.

Privacy, offline use, browser support, and pricing questions are answered on the site-wide FAQ.

See all Converters