HTML to PDF Converter

Convert HTML code or .html files into PDF documents that keep your CSS styles, colours, fonts and images. Preview the page live, then download a print-ready PDF.

  • 100% free
  • No sign-up
  • Private & local
  • Works on mobile
Drop an HTML file hereor browse files · or edit the code below
Live preview

PDF settings

Auto creates a PDF with selectable text, switching to exact-look rendering for non-Latin scripts (e.g. Hindi, Arabic, Chinese).

Private by design: your files are processed locally in your browser and are never uploaded to any server.

What Is an HTML to PDF Converter?

An HTML to PDF converter renders HTML markup, the code behind every web page, and saves the result as a PDF document. Developers use it to turn invoices, receipts, reports, certificates and email templates into downloadable PDFs. Everyday users convert saved web pages or HTML exports into documents that are easy to print and share.

Our converter renders your HTML with the browser's own layout engine, so CSS styles, web fonts, colours, backgrounds, flexbox and grid layouts, tables and images appear in the PDF just as they do on screen. Everything runs locally in your browser. JavaScript inside the HTML is disabled for security, and your code is never uploaded.

How to Convert HTML to PDF

  1. Add your HTML. Paste code into the editor or drop an .html file. The live preview updates as you type.
  2. Choose page settings. Pick A4, Letter, Legal or A5, portrait or landscape, and the margins.
  3. Pick a rendering mode. "Exact look" keeps your CSS design. "Selectable text" creates a text-based PDF with basic formatting.
  4. Download the PDF. Click "Convert to PDF". Pages are split between lines of content, not through them.

Features

  • Full CSS supportInline, embedded <style> CSS and web fonts are rendered accurately.
  • Live previewSee your HTML rendered side by side while you edit.
  • Smart page breaksContent is split at blank space between lines, so text is never cut in half.
  • Vector print optionUse Print / Save as PDF for a vector PDF that respects @media print and page-break CSS rules.
  • Safe by designScripts and event handlers are stripped before rendering.
  • No uploadYour markup, including any private data in invoices or reports, stays on your device.

Three Ways to Create Your PDF

MethodResultBest for
Exact lookHigh-resolution image of each pageDesigned layouts, certificates, receipts
Selectable textSearchable text PDF with headings, lists and tablesArticles and documentation
Print / Save as PDFVector PDF from the browser print engineMulti-page documents with print CSS

Tips for Print-Ready HTML

  • Use relative widths (%, max-width) so the layout fits the page width. The PDF content width for A4 with normal margins is about 640 pixels.
  • Images must be embedded as data URIs or hosted on servers that allow cross-origin loading. Otherwise they may not appear.
  • Add page-break-before: always to elements that should start a new page when using Print / Save as PDF.
  • External stylesheets linked with <link> load only if the server allows it, so embedding critical CSS in a <style> tag is safest.

Page Breaks Without Cut-Off Text

A common problem with HTML to PDF tools is text sliced in half at the bottom of a page. In exact-look mode, this converter scans the rendered image for a blank horizontal strip near each page boundary, the gap between lines or elements, and breaks the page there. Each page therefore ends on a clean line. For complete control, use Print / Save as PDF with CSS rules like break-inside: avoid on tables and cards.

Popular Uses for HTML to PDF Conversion

  • Invoices and receipts: design an invoice template in HTML and CSS, fill in the details and export a professional PDF for your client.
  • Certificates and tickets: course certificates, event tickets and vouchers are easy to style in HTML and look sharp as PDF.
  • Reports and dashboards: save HTML reports generated by analytics or testing tools as a shareable PDF snapshot.
  • Email archives: keep a permanent PDF record of HTML newsletters and transactional emails.
  • Resumes: build a CV with HTML and CSS for full design control, then export it as the PDF recruiters expect.

Because conversion happens in your browser, it is also a safe way to produce PDFs from templates that contain customer names, addresses and prices. That data never touches a third-party server.

Frequently Asked Questions

What page width does my HTML render at?

The HTML is laid out at the printable width of the selected page. For A4 portrait with normal margins, that is about 640 CSS pixels, so responsive layouts adapt automatically.

Does the HTML to PDF converter support CSS?

Yes. Exact-look mode renders your HTML with full CSS support, including colours, backgrounds, borders, web fonts, flexbox and grid.

Can I convert a website URL to PDF?

Browsers block pages from reading other websites for security reasons, so this tool converts HTML code and files. To convert a live web page, open it and use your browser's Print → Save as PDF, or save the page as HTML and upload it here.

Will JavaScript in my HTML run?

No. For your security, scripts are removed before rendering. Content generated by JavaScript will not appear, so include the final HTML.

Why are my images missing from the PDF?

Images hosted on other websites can only be drawn if that server allows cross-origin access. Embed images as Base64 data URIs (see our Image to Base64 tool) for guaranteed results.

Is it free and private?

Yes. The converter is free, with no limits. It runs entirely in your browser, and your HTML is never uploaded.