Convert HTML to PDF Online Free

How HTML to PDF Converter Works

Fast, private in-browser document processing engineered with enterprise-grade accuracy.

1

Input HTML

Paste your raw HTML code or upload an .html file with inline CSS styling.

2

Configure Options

Choose page size (A4, Letter, Legal), margins, and orientation (portrait or landscape).

3

Generate & Download

Click Convert to render your document with Chromium and download your PDF instantly.

Headless Chromium Engine

Renders modern HTML5, CSS3, Flexbox, and Grid with pixel-perfect precision.

Page Size & Layout Control

Supports standard A4, A3, Letter, and Legal dimensions with custom margins.

Instant Live Preview

Test your HTML and review output formatting before saving to your computer.

Private & Secure

All files are processed in-memory and deleted immediately after conversion.

Frequently Asked Questions

Everything you need to know about formats, browser privacy, and file handling.

How do I prevent elements like tables or cards from splitting across page breaks?▼

Use CSS print page-break properties on your elements. Add 'break-inside: avoid;' or 'page-break-inside: avoid;' to cards, table rows, and container blocks. For tables, also declare 'thead { display: table-header-group; }' and 'tr { break-inside: avoid; }' to repeat header rows cleanly without cutting through data rows.

Can I use Google Fonts, custom web fonts, and external CSS stylesheets?▼

Yes. You can link to Google Fonts or CDN stylesheets via standard <link> tags or CSS @import rules. Because our Chromium engine executes with network access, web fonts and styles render accurately. For optimal speed and offline consistency, embedding fonts as base64 in a <style> block is also supported.

How can I include repeating headers, footers, and page numbers?▼

You can use CSS paged media rules like '@page { margin: 20mm; @bottom-center { content: counter(page); } }' or Gotenberg Chromium print options. Our engine also supports standard HTML/CSS header and footer templates where classes like 'pageNumber' and 'totalPages' are automatically populated.

Is modern JavaScript (React, Vue, Chart.js) executed before PDF rendering?▼

Yes. Our conversion engine uses a full headless Chromium browser that executes client-side JavaScript, resolves DOM changes, renders SVG graphics, and waits for animations or charts (like Chart.js or ApexCharts) to complete before creating the print layout.

Why do background colors or CSS gradients not show up in the PDF output?▼

Browsers default to printing without background graphics to save ink. To force background colors, gradients, and images to render in your PDF, add '-webkit-print-color-adjust: exact;' and 'print-color-adjust: exact;' to your root or container CSS selectors.

How do I configure custom page sizes and margins (A4, Letter, Landscape)?▼

You can define page dimensions directly in your CSS using the '@page' rule (for example, '@page { size: A4 landscape; margin: 15mm; }') or use our tool's visual options panel to pick standard sizes like A4, A3, Letter, Legal, and custom margin presets.

Can I convert HTML that uses relative image paths or external CDN images?▼

External image URLs (HTTPS) load seamlessly during conversion. If you are uploading a single raw HTML file with local image references, convert images to inline base64 data URIs ('data:image/png;base64,...') so all assets are self-contained.

Does the converter support modern Flexbox and CSS Grid layouts?▼

Yes, full CSS Flexbox and CSS Grid specifications are supported without layout bugs, unlike legacy wkhtmltopdf converters. Headless Chromium guarantees pixel-perfect layout parity between your modern web browser and the generated PDF.

Is text in the generated PDF selectable, searchable, and hyperlinked?▼

Absolutely. The converter outputs true vector PDFs with selectable, searchable text and live hyperlinks (from standard <a href> tags). Vector graphics such as SVGs remain sharp and infinitely scalable at any zoom level.

Are my uploaded HTML code and files stored or logged on your servers?▼

No. All conversion operations take place in temporary, isolated sandbox containers in memory. Once your document is converted and delivered to your browser, all source code and temporary files are permanently purged.