Drop it anywhere
pdfhook

HTML to PDF

Converts pasted HTML, an uploaded .html file, or (when accessible) a live URL into a PDF.

  • No upload — runs on your device
  • Free, no sign-up
  • No watermark

What HTML to PDF does

Converts pasted HTML, an uploaded .html file, or (when accessible) a live URL into a PDF. Turning a webpage or HTML content into a PDF is useful for saving an article, archiving a page's content, or sharing a webpage as a document. Static HTML and CSS render reliably whether pasted directly, uploaded as a file, or fetched from a live URL when accessible — though many websites block cross-origin requests that would let a browser-based tool fetch their content directly, so pasting HTML or uploading a saved copy is the more reliable path for pages that won't fetch by URL.

Works well with: Merge PDF · Compress PDF · Page Numbers

Runs 100% in your browser

PDFHook processes this file using JavaScript on your own device. It's never uploaded, stored, or seen by anyone else — and it works even if your connection drops mid-way.

HOW TO USE IT

HTML to PDF in 3 steps

1

Provide your HTML

Paste it directly, upload an .html file, or enter a URL.

2

Rendering runs automatically

The page is rendered the way a browser would show it.

3

Download the PDF

Long pages are split across multiple pages automatically.

Key features

  • Paste HTML, upload a file, or enter a URL
  • Renders exactly as a browser would
  • Multi-page output for long pages
  • Accepts pasted HTML, an uploaded file, or a live URL
  • Multi-page output for content taller than one page

Practical use cases

  • Someone wants to save an online article as a PDF for offline reading.
  • A developer needs to convert a rendered HTML report into a shareable PDF document.
  • A user wants to archive a webpage's content before it potentially changes or disappears.

Related terminology

Cross-origin request
A request made from one website to fetch content from a different website, often blocked by the target site's security policy — the reason a live URL sometimes can't be fetched directly.

The complete guide to HTML to PDF

Quick answer

To convert HTML to PDF, paste HTML code, upload an .html file or enter a URL in PDFHook's HTML to PDF tool and download the PDF. Pasted and uploaded HTML renders as a browser would show it; live URLs may fail because websites often block cross-origin requests.

What HTML to PDF is for

HTML is the language of web pages. Converting it to PDF gives you a fixed, shareable copy: an invoice generated by a template, a saved article, a receipt, a landing page, documentation or a report built in HTML. PDFs print predictably and can be attached to emails or stored for records.

Three ways to provide content

  1. Paste HTML. Paste your own HTML code into the box. This is the most reliable method and gives you full control of the result.
  2. Upload an .html file. Useful for saved pages or templates stored on your device.
  3. Enter a URL. The tool can try to fetch a live web page, but this depends on the website allowing it.

Why some URLs fail

Browsers protect users with a security rule called cross-origin resource sharing (CORS). A web page is generally not allowed to read the content of another site unless that site permits it. Because PDFHook runs in your browser, it is subject to this rule. Many sites do not allow their pages to be fetched this way, so entering their URL can fail even when the page opens normally in your browser.

If a URL does not convert:

  • Open the page yourself, use View → Save Page As (or copy the page's HTML source) and use the paste or upload options instead.
  • Use your browser's Print → Save as PDF option for the live page.
  • Try a page you control or one that allows cross-origin access.

This limitation is a direct consequence of the privacy-friendly design: the conversion happens on your device instead of on a server that can fetch any website for you.

What the rendering includes

The tool renders HTML and CSS as a browser would, so headings, paragraphs, tables, lists, images and CSS styling are carried into the PDF. Long pages are split across multiple PDF pages automatically.

Some content behaves differently:

  • JavaScript-generated content may not appear if it needs scripts to run or fetch data after loading.
  • External resources such as images or fonts loaded from other websites may be blocked by the same cross-origin rules.
  • Interactive elements like menus, forms and videos become static in the PDF.

For the most predictable result, use self-contained HTML with inline CSS and embedded images.

Good use cases

  • Turning an HTML invoice, receipt or certificate template into a PDF
  • Saving documentation or notes written in HTML
  • Converting email-style HTML into a printable copy
  • Creating PDFs from reports generated by scripts or tools

Tips for clean output

  1. Use inline or embedded CSS so styling travels with the HTML.
  2. Embed images as data URIs, or use images that allow cross-origin use.
  3. Set simple page-friendly widths. Fixed, very wide layouts can be cut off.
  4. Avoid reliance on scripts for important content.
  5. Post-process the PDF. Add page numbers, a watermark or compress the file.

Common mistakes

  • Assuming any URL will work. Many will not because of cross-origin restrictions.
  • Expecting script-driven content. Dynamic content may be missing.
  • Using relative links to images that do not exist on your device.
  • Forgetting print styles. Layouts designed for screens can look cramped on a page.

HTML to PDF vs browser print

Your browser's print dialog can also save a page as PDF, and for live websites it is often the easiest option. PDFHook's tool is useful when you have HTML as code or a file, want it rendered without opening it, or want to process it with other PDF tools afterwards.

Privacy

HTML you paste or upload is rendered in your browser and is not sent to a server, which is helpful for invoices and internal documents. See how PDFHook compares with upload-based tools.

Convert other formats with Word to PDF or Excel to PDF, and combine results using Merge PDF.

Frequently asked questions

Why did converting a URL fail?

Most websites block cross-origin requests from other sites for security reasons, which prevents fetching their HTML directly in the browser. Paste the HTML or upload a saved copy instead.

Will JavaScript-driven content appear in the PDF?

Static HTML and CSS render reliably; content that loads dynamically via JavaScript after the page loads may not appear.

What should I do if a URL won't convert?

Copy the page's HTML source and paste it directly, or save the page as an .html file and upload it — both avoid the cross-origin restriction that blocks some direct URL fetches.

Does this support CSS styling?

Yes — standard CSS is rendered along with the HTML content, producing a page that closely matches how a browser would display it.

Can I convert a website to PDF using just the URL?

Often yes, though some sites block direct URL fetching — pasting the page's HTML source or uploading a saved .html file is the more reliable fallback.

Is there a free HTML to PDF converter online?

Yes — this html to pdf converter free tool lets you convert webpage to PDF, save HTML as PDF, and works as a website to PDF online tool alongside its URL to PDF converter option.

Is HTML to PDF free?

Yes, and there is no sign-up, watermark or daily limit — everything runs in your browser rather than on a metered server.

How do I convert HTML to PDF online for free?

Paste your HTML or upload a file into HTML to PDF and download the result. It is free and runs in your browser.

Will JavaScript-driven content appear?

Content that needs scripts to load may be missing. Use static HTML for best results.

Does it support CSS styling?

Yes. HTML and CSS are rendered as a browser would, with styles included in the PDF.

Is my HTML uploaded?

No. It is rendered in your browser.