HTML to PDF

Paste HTML code or a URL and convert it to a clean PDF.

HTML to PDF renders HTML in your browser and saves it as an A4 PDF — useful for turning a snippet, an email template or a saved page into a document. Paste your HTML on the HTML Code tab, or use the URL tab to fetch a page. Inline styles and embedded style blocks are kept; external stylesheets may not load because of browser security rules. Because the page is captured as an image, the text in the PDF is not selectable.

What you can do

  • Two inputs: paste HTML directly, or fetch a page from a URL.
  • A4 output, with long content flowing onto extra pages automatically.
  • Inline styles and embedded style blocks are preserved.
  • Captured at high resolution so the result prints sharply.

How it works

  1. 1Open the HTML Code tab and paste your HTML — or open the URL tab and enter a web address.
  2. 2Click Convert to PDF.
  3. 3The PDF downloads automatically; click Download Again if you need it a second time.

Why use SmilingPDF for this

  • Works with raw HTML you wrote yourself, with no web address needed.
  • Nothing is rendered on a server, so what you paste is not sent anywhere.
  • Free, with no watermark.

Private by design

Your file stays on your device.

  • No upload
  • No server storage
  • No account required
  • Browser-based processing
  • No watermark

This tool runs inside your browser tab. Your file is read from your device, processed there, and handed back as a download — it is never sent to a SmilingPDF server, so there is nothing for us to store, read, or lose. You can check for yourself: open your browser's developer tools, switch to the Network tab and run the tool. Like most sites, SmilingPDF uses Google Analytics to count visits and which tools are used; that never includes the contents of your files. The privacy policy lists everything the site does collect.

Pasted HTML is rendered and converted entirely on your device. If you use the URL tab, your browser requests that page directly from its own website — no SmilingPDF server is involved — and some sites block that. Pasting the page source into the HTML Code tab always works.

Related tools

FAQ

Frequently asked questions

Got questions? We've got answers.

How does HTML to PDF conversion work?

Your HTML is rendered in a hidden container in your browser, captured as a high-resolution image, then embedded page-by-page into a proper A4-sized PDF document.

Can I convert a website URL to PDF?

Yes, but with a caveat: many websites block direct browser requests (CORS). If a URL fails, copy the page source (Ctrl+U / Cmd+U) and paste it in the HTML Code tab instead.

Is my content uploaded to a server?

No. Everything is processed locally in your browser. Your HTML and the resulting PDF never leave your device.

Will CSS styles be preserved?

Inline styles and embedded <style> blocks are preserved. External stylesheets (linked via <link>) may not load due to browser security restrictions.

What page size is the output?

The PDF uses A4 page dimensions (210 x 297 mm). Long content is automatically split across multiple pages.

Your HTML is rendered in a hidden container in your browser, captured as a high-resolution image, then embedded page-by-page into a proper A4-sized PDF document.