HTML to PDF

Convert HTML code or a .html file directly to a downloadable PDF — no print dialog, no server. Choose page size, orientation, margin, and render quality.

html pdf convert
Free Client-Side Private
🔒 This tool runs entirely in your browser — your files are never uploaded to any server.

Convert any HTML document or snippet into a PDF file with a single click — no print dialog, no server upload, everything runs entirely in your browser. Paste your HTML code or load a .html file, choose the page size, orientation, margin, and render quality, then click Download PDF. The file is generated client-side using html2canvas and jsPDF and saved directly to your device.

How to use

Paste your HTML into the text area, or click Load .html file to open a file from disk. You can also drag and drop a .html file straight onto the textarea. Set your desired page options and click Download PDF. The tool renders your HTML, converts it to an image-based PDF, and triggers an automatic file download — no browser print dialog involved.

Options

  • Page size — A4 (210 × 297 mm), Letter (215.9 × 279.4 mm), A5 (148 × 210 mm), or Legal (215.9 × 355.6 mm).
  • Orientation — Portrait or Landscape.
  • Margin — Narrow (10 mm), Normal (20 mm), or Wide (30 mm).
  • Render quality — Normal (1×), High (2×), or Ultra (3×). Higher quality produces a sharper PDF at the cost of a larger file size and longer processing time.
  • Output filename — Optionally specify a custom filename for the downloaded PDF.

Tips

  • Full HTML5 pages (starting with <!DOCTYPE html> or <html>) are rendered as-is. Plain HTML snippets are automatically wrapped in a minimal document with a sans-serif base style.
  • External images and stylesheets load only if the URLs are reachable from your browser — CDN links and locally served files both work.
  • For large or complex pages, choose High (2×) quality for a good balance between sharpness and file size.
  • Long pages are automatically split across multiple PDF pages to fit the chosen paper size.

FAQ

Does it support CSS styles and web fonts?

Yes. html2canvas renders your HTML in a hidden iframe, so your CSS rules, inline styles, and most web fonts are respected. Google Fonts and other CDN-hosted fonts will load if your browser can reach them.

Does it support JavaScript inside the HTML?

No. The rendered iframe is isolated for security reasons. Static HTML and CSS are fully supported; JavaScript inside the input HTML will not execute.

Why is the PDF made of images rather than selectable text?

This tool converts HTML to a visual snapshot (canvas) which is then embedded in the PDF. This approach preserves the exact visual appearance of your page. Use a server-side tool if you need a text-searchable PDF.

What page sizes are supported?

A4, Letter, A5, and Legal — in both portrait and landscape orientations.

Is my HTML code sent to any server?

No. The entire conversion happens in your browser. Your HTML code never leaves your device.

How large can the input HTML be?

There is no hard limit, but very large or resource-heavy pages may be slow to render. For best results keep the page focused on the content you want to export.

Report an issue