We use cookies

We use cookies to enhance your experience and analyse site usage.

100 PDFs / month free · No credit card required

HTML to PDF in one API call

Generate pixel-perfect invoices, reports, receipts, and documents from HTML or any URL. Or skip the code entirely — use our online playground.

PDF from HTML in one request
# Generate invoice.pdf
curl -X POST https://api.htmlpdf.dev/api/pdf \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html": "<h1>Invoice #1042</h1>", "format": "A4"}' \
  --output invoice.pdf

# ✓ Saved invoice.pdf (42 KB) in 380ms
Works with every stack:Node.jsPythonPHPGoRuby.NETJavacURL
No code required

Generate PDFs directly in your browser

Paste your HTML, choose paper size and margins, then hit Generate. Preview and download the PDF without writing a single line of code. When you're ready, the equivalent API call is right there to copy.

Open playground
Playground
invoice.pdf
42 KB · A4

How it works

Three steps to your PDF

01

Send HTML or a URL

POST your HTML template or any public URL to the API with your formatting options.

02

Chrome renders it

Our pooled headless Chromium instances render the page at full resolution with your CSS.

03

Get a pixel-perfect PDF

Receive binary, base64, or JSON response in under 500ms. Ready to save or stream.

Features

Everything you need

Powerful options, dead-simple API. Use the online playground to explore — no setup required.

Try online

Online playground

No code needed. Paste HTML, adjust settings, and download your PDF — all in the browser. Perfect for quick testing.

HTML & URL modes

Render from raw HTML for template-based generation, or capture any live URL as a PDF. One endpoint, two powerful modes.

Sub-500ms generation

Browser pooling keeps Chrome warm. Simple documents render in under 500 milliseconds, every time.

Full page control

Paper size, margins, headers, footers, page numbers, backgrounds, scale — every Chromium PDF option exposed.

Print & screen modes

Toggle between CSS print and screen media types. Get exactly the output your stylesheets define.

Smart wait strategies

Wait for selectors, network idle, or custom timeouts. SPAs and dynamic content render perfectly.

Developer-first

JSON errors, descriptive status codes, official SDKs for Node/Python/Go, and docs you'll enjoy reading.

Use cases

Built for every document type

Start from one of our 10 ready-made templates or bring your own HTML.

Invoices

Free HTML template included

Reports

Free HTML template included

Certificates

Free HTML template included

Receipts

Free HTML template included

Integrate in minutes

Works with any language

A single HTTP request — no SDK required.

example.sh
curl -X POST https://api.htmlpdf.dev/api/pdf \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html": "<h1>Invoice #1042</h1>", "format": "A4"}' \
  --output invoice.pdf

Pricing

Simple, transparent pricing

Start free, scale as you grow. No surprises.

Free

Try it out, no card needed

$0/month
  • 100 PDFs/month
  • Basic API access
  • All paper formats
  • Community support
Start free

Starter

For side projects & small apps

$19/month
  • 500 PDFs/month
  • All options & formats
  • Headers & footers
  • Email support
Get started
MOST POPULAR

Growth

For growing applications

$49/month
  • 2,500 PDFs/month
  • All options & formats
  • Async mode
  • Priority support
Get started

Business

For production workloads

$99/month
  • 10,000 PDFs/month
  • All options & formats
  • Custom fonts
  • Priority support
  • Async mode
Get started

Scale

High-volume & enterprise use

$249/month
  • 50,000 PDFs/month
  • Webhook callbacks
  • Bulk API
  • Custom fonts
  • Priority support
Get started

Enterprise

Mission-critical PDF generation

$499/month
  • 200,000 PDFs/month
  • SLA guarantee
  • Dedicated support
  • Webhooks & bulk API
  • Custom fonts
  • Priority queue
Get started

FAQ

Frequently asked questions

Free forever — no credit card needed

Ready to generate your first PDF?

100 PDFs free every month. Try the online playground or integrate the API in minutes.