HTML to PDF
Convert web pages or HTML code to PDF. Enter a URL or paste HTML directly.
Convert a webpage URL or raw HTML to PDF. Powered by Puppeteer (headless Chrome), so the output renders the page exactly as Chrome would — CSS, web fonts, images, and all. Useful for archiving articles, generating reports from web apps, or producing printable receipts.
The page must be publicly accessible. JavaScript-heavy pages may not render perfectly.
How HTML to PDF works
Converting HTML to PDF means rendering the HTML document — with all its CSS, web fonts, JavaScript-generated content, and embedded images — and capturing the rendered output as a paginated PDF. SwitchPDF uses Puppeteer, which is a headless Chrome browser controlled programmatically. Chrome opens the URL or the raw HTML, waits for fonts and images to load, executes any JavaScript (within a safe sandbox), and then exports the rendered page using Chrome's built-in "Save as PDF" function.
This produces the highest-fidelity HTML-to-PDF output of any free tool because it uses the actual Chrome rendering engine. Server-side libraries like wkhtmltopdf or older versions of weasyprint render HTML through their own implementations, which often diverge on modern CSS features (flexbox, grid, web fonts, CSS custom properties). With Puppeteer, anything that works in Chrome works in the PDF — including modern CSS Grid layouts, Google Fonts, and gradients.
For URL inputs, we fetch the page over HTTPS and load it in Chrome's sandbox. The page sees a real browser, so JavaScript-rendered single-page apps (React, Vue, Svelte) render correctly. For HTML inputs you paste in, the same rendering pipeline runs against the raw markup. CSS @page rules for paper size and margins are respected, so you can control pagination from your HTML.
Common use cases: archiving blog articles in a permanent format; generating printable receipts or invoices from a web app; turning a custom-styled HTML email into a PDF for sharing; capturing rendered reports from internal dashboards.
How to use HTML to PDF
Enter a URL or paste HTML
Type a public webpage URL (e.g. https://example.com/article) or paste raw HTML source code.
Configure (optional)
Choose paper size, orientation, margins, and whether to include the page background. Defaults work for most cases.
Convert and download
Click "Convert to PDF" — Chrome renders the page server-side and produces the PDF. Download the result.