pdfcosmos

HTML to PDF

Convert an HTML file or pasted HTML code to PDF, as clean selectable text, or a full-design render of the page. Your files are never uploaded to a server.

Free, fast, and privacy-first.

Convert HTML to PDF

or drag & drop files here

.html & .htm filesup to 30 filesup to 100 MB each300 MB total

Convert HTML to PDF: in your browser, your files never uploaded

Turn a local .html or .htm file (a saved article, an exported email, a report, a documentation page), or HTML you paste in directly, into a PDF, entirely in your browser. Your files are never uploaded to a server. Choose the page size, orientation, and margins to fit your document.

Pick the rendering that fits. The default Clean-text mode converts the HTML's content (headings, paragraphs, lists, tables, links, bold/italic, and code) into a readable PDF with a clean built-in style, as real selectable text. It doesn't reproduce the page's own CSS and it fetches nothing (remote images show as alt text, scripts and iframes are stripped). Full-design mode instead renders the page the way a browser does (running its own CSS and JavaScript so colours, layout, tables, and charts appear) and captures it as an image. Because it truly renders the page, it loads the page's own external assets and runs its scripts (your file is still never uploaded). For selectable text with the full design, the “Print for selectable text” button hands off to your browser's Save as PDF.

  • File or pasted code

    Convert .html/.htm files, or paste raw HTML straight in, same local pipeline.

  • Page size, orientation, margins

    A4/Letter/Legal/A3/A5, portrait or landscape, and custom margins in mm/cm/in/px.

  • Clean text or full design

    Selectable clean text with nothing fetched, or a full-design render with colours, styles, and charts.

  • Batch files to one ZIP

    Convert up to 30 files at once. Several download together as a ZIP.

How to convert HTML to PDF

  1. Add HTML: a file or pasted code

    Drop one (or up to 30) .html/.htm files into the upload area, or switch to “Paste code” and type or paste your HTML. (Local only, not a web address.)

  2. Pick the rendering & page layout

    Choose Clean text (private, selectable) or Full design (colours, styles, and charts). Then set page size (A4, US Letter, Legal, A3, A5), orientation, and margins.

  3. Convert & download

    Click “Convert to PDF”. Everything runs in your browser and downloads as a PDF (a ZIP for several files).

Frequently asked questions

Is my HTML uploaded to a server?
No. Your HTML is never uploaded, in either mode. The conversion runs entirely in your browser. In the default Clean-text mode nothing is fetched from the internet either, and you can confirm it in your browser's Network tab. In Full-design mode your file is still never uploaded, but because the page is actually rendered, the browser loads the page's own external assets (styles, fonts, chart scripts) and runs its scripts, exactly like opening the file in a tab.
Can I paste HTML code instead of a file?
Yes. Switch to the “Paste code” tab and type or paste your HTML. It's converted the same way as an uploaded file, in your browser, with the same clean built-in style and the same local-only guarantees.
Can I enter a website URL?
No. This tool converts HTML you already have (a file or pasted code), not live web pages. Fetching a website would send the request to a server and download its remote resources, which would break the promise that nothing leaves your device. To save a live page, use your browser's own File → Print → Save as PDF.
Can I choose the page size, orientation, and margins?
Yes. Pick A4, US Letter, Legal, A3, or A5, in portrait or landscape, and set the top/right/bottom/left margins in millimetres, centimetres, inches, or pixels. The same options apply whether you upload a file or paste code.
Does the PDF look exactly like the original page?
It depends on the mode. The default Clean-text mode converts the HTML's content (headings, paragraphs, lists, tables, links, bold/italic, and code) in a clean built-in style as real, selectable text. It does not reproduce the page's own CSS, and nothing external is loaded (so a design-heavy page like an infographic comes out as clean text). Full-design mode does reproduce the design: it runs the page's own CSS and JavaScript, so colours, layout, tables, and charts appear, but the output is a rendered image, so its text isn't selectable. For selectable text at full fidelity, use the “Print for selectable text” button and choose Save as PDF.
What happens to images and scripts?
In Clean-text mode, images embedded as data: URLs are drawn into the PDF. Images that link to a remote URL are not downloaded and appear as their alt text. Scripts, iframes, and remote stylesheets are removed entirely, so nothing is fetched or run. In Full-design mode the page is rendered as-is: its scripts run and its external images, fonts, and stylesheets load (your file is still never uploaded).
Are hyperlinks clickable in the PDF?
Yes, in both modes. In Clean-text mode, http/https/mailto links are drawn as underlined, clickable links. In Full-design mode the page is a rendered image, but clickable link areas are overlaid on top of it, so those same links still work (the text itself stays part of the image and isn't selectable, so use “Print for selectable text” when you need selectable text too). Relative links and in-page anchors are skipped in both, since they can't resolve once the page is a standalone PDF.
Can I select or search the text in the PDF?
In Clean-text mode, yes. The PDF contains real, selectable text (not an image), so you can copy, search, and highlight it, and it stays crisp at any zoom. The built-in fonts cover Latin scripts. Other scripts (for example Chinese, Japanese, or Arabic) may not render. Full-design mode outputs a rendered image, so its text isn't selectable. For selectable text with the full design, use “Print for selectable text” and choose Save as PDF.
Is HTML to PDF free?
Yes, it's completely free to use, with no sign-up and nothing to install.