HTML to PDF Converter
Turn HTML into a PDF with selectable text using your browser’s Save as PDF, with a safe preview and page size, orientation and margins.
Runs in your browserHTML → PDF
Loading tool…
How to use the HTML to PDF Converter
- Paste HTML (a full page or a fragment) or open an .html file. Inline <style> blocks and remote stylesheets are applied.
- Pick the page size, orientation and margin, then press "Save as PDF". In the print dialog choose "Save as PDF" (Chrome, Edge, Firefox, Safari) or "Microsoft Print to PDF" as the destination.
- The PDF is produced by your browser’s own print engine, so text stays real text: selectable, searchable and sharp at any zoom.
- Turn on "Background graphics" in the print dialog too if coloured backgrounds are missing, and turn off "Headers and footers" for a clean page.
Privacy and limitations
- Your data is processed on your device and is not uploaded to any server.
- JavaScript in the HTML is removed and never runs, so pages that build their content with scripts print empty or incomplete.
- Relative links to images and stylesheets cannot be resolved; use absolute https:// URLs or data: URIs. Forms, iframes and embedded objects are removed.
- Page size and margins are applied via CSS @page, which some browsers (notably Safari) only partly support; the print dialog settings may take precedence.
- The exact rendering depends on your browser; there is no server-side engine for pixel-identical PDFs.
Frequently asked questions
Is my HTML uploaded to a server?
No. The HTML is sanitised and printed entirely in your browser; nothing is sent anywhere. Scripts are removed and never run.
Why is my page size or margin ignored?
The settings are applied with CSS @page rules. Chrome and Edge follow them fully; Firefox and Safari may keep the paper size chosen in the print dialog, so set it there as well.
Related converters
HTML ViewerPreview HTML safely in a sandboxed frame where scripts, forms and network requests are blocked.Markdown to HTML ConverterConvert Markdown (including GitHub tables and strikethrough) to sanitised HTML with a safe live preview.Image to PDF ConverterCombine JPG, PNG, WebP and HEIC images into one PDF, in the order you choose, with A4, Letter or fit-to-image pages.HTML Table to JSON ConverterConvert an HTML <table> into a JSON array of objects keyed by the header row, with optional number detection.HTML Table to CSV ConverterExtract an HTML <table> into CSV, expanding colspan and rowspan cells. Pick which table when there are several.Text to HTML ConverterTurn plain text into HTML paragraphs and line breaks, escaping special characters and optionally linking URLs.HTML to JSX ConverterConvert HTML to React JSX: class to className, inline styles to objects, self-closing void tags and JSX comments.HTML to Text ConverterStrip HTML tags and extract readable plain text, keeping paragraphs, line breaks and list bullets.