Skip to main content
DevBench

How to save HTML as a PDF

  1. Paste your HTML into the editor — a full document with its own <style> block works, and so does a bare fragment, which gets wrapped with sensible default styling.
  2. Watch the live preview below: it re-renders as you type, so the print output is never a mystery.
  3. Press Print / Save as PDF and pick Save as PDF as the destination in the dialog.
  4. Set margins to “Default” or “Minimum” for a cleaner page, then save.

Powered by your browser’s print pipeline

This tool does not run a headless converter — it prints the sandboxed preview frame through the browser’s own print dialog, which is why the PDF matches what you saw on screen. That also means print headers, footers and margin behaviour follow your browser’s options, and both Chrome and Safari support the Save as PDF destination. It is the right choice when the layout matters: newsletters, one-pagers, invoice templates, or any HTML with fonts and colours that a plain-text generator cannot express. Nothing is uploaded — the HTML never leaves the tab.

Paste HTML you trust

The preview runs in a sandboxed iframe, but the usual caution still applies: only paste markup you wrote or copied from a source you trust. If you are starting from Markdown, convert it to HTML first; if you are starting from plain notes, Text to PDF is the quicker path with no styling decisions at all. The editor is plain text with no auto-formatting, so what you paste is exactly what prints.

Also useful: Text to PDF, HTML Preview, and Markdown → HTML.