Skip to content

HTML to PDF Converter — Free, Keeps CSS, No Upload

Convert HTML to PDF in your browser. Paste code or open an .html file; <style> rules and inline CSS are kept, scripts removed. Page numbers, password.

Convert in your browser · No sign-up

Up to 2 MB of HTML. Scripts, forms and embedded frames are removed; the preview shows what goes into the PDF.

Page setup

How to use

  1. Paste HTML or open an .html/.htm file; the preview updates as you type.
  2. Set paper size, orientation, margins and page numbers, and add a watermark or password if needed.
  3. Select Download PDF to save the file created in this tab.

Example

<h1 style="color:#4338ca">Invoice</h1> → a PDF with a blue heading and selectable text.

Details and limitations

Rules in <style> blocks and style attributes are applied, and @media print rules are used. They stay inside the document and do not change this page. Linked stylesheets, @import and web fonts are not loaded: text is set in Noto Sans and code in Noto Sans Mono.

Remote images appear only if their server allows cross-origin loading (CORS); others and relative paths become a labelled box. Data URIs always work. The preview loads remote images from their servers, while your HTML itself stays in your browser.

FAQ

Does JavaScript in my HTML run before the PDF is made?

No. Scripts, event handlers and javascript: links are removed with DOMPurify, so pages that build their content with JavaScript come out empty. Paste the rendered HTML instead, for example from your browser's developer tools.

Can I convert a web page by its URL?

No. Browsers do not let one site read another site's pages, so open the page, save it as an .html file or copy its HTML, and convert that.

Is the text in the PDF selectable?

Yes. The layout is made by your browser and written as vector text with embedded Noto fonts, including Chinese, Japanese and Korean. Arabic and Hebrew are not supported yet; the print dialog is offered instead.

Format references

Tool page updated: