HTML to PDF

Convert your HTML code into beautifully formatted PDF documents with full CSS support

PDF generated successfully!

Download PDF

How to Convert HTML to PDF

  1. Write or paste HTML — Enter your HTML code in the editor area. You can include CSS styles inline or in the <head> section.
  2. Preview — Click "Load Sample" to see an example. Use it as a starting point for your own documents.
  3. Convert — Click "Convert to PDF". The HTML is rendered into a PDF with full CSS support.
  4. Download — Download the generated PDF file.
💡 Tip: Use <link> or inline styles. Both work. For printed layouts, consider adding @page { margin: 20mm; } in your CSS.

Example Use Cases

📝 Generate Invoices

Create professional PDF invoices from HTML templates. Style them with CSS for a polished look.

📊 Reports & Dashboards

Convert data-driven HTML reports into downloadable PDFs with charts, tables, and formatted text.

📋 Certificates & Forms

Generate certificates, forms, or tickets from HTML. Print-ready with exact pixel positioning.

<style>
  .certificate { border: 2px solid gold; padding: 40px; text-align: center; }
</style>
<div class="certificate">
  <h1>Certificate of Completion</h1>
  <p>Awarded to: John Doe</p>
</div>

FAQ — HTML to PDF

What CSS styles are supported?
All modern CSS is supported including Flexbox, Grid, animations, fonts, and colors. The PDF is rendered using Chromium's rendering engine.
Can I use external stylesheets?
Yes, but we recommend using inline styles or <style> tags within the HTML for faster rendering and consistent results.
What page size will the PDF be?
The PDF is generated in A4 format by default. You can control margins with @page { margin: ...; } in your CSS.
Can I include images in my HTML?
Yes. You can use base64-encoded images (data:image/...;base64,...) or external image URLs. External URLs will be loaded during conversion.