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.
# 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
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 playgroundHow it works
Three steps to your PDF
Send HTML or a URL
POST your HTML template or any public URL to the API with your formatting options.
Chrome renders it
Our pooled headless Chromium instances render the page at full resolution with your CSS.
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.
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.
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.pdfPricing
Simple, transparent pricing
Start free, scale as you grow. No surprises.
Free
Try it out, no card needed
- 100 PDFs/month
- Basic API access
- All paper formats
- Community support
Starter
For side projects & small apps
- 500 PDFs/month
- All options & formats
- Headers & footers
- Email support
Growth
For growing applications
- 2,500 PDFs/month
- All options & formats
- Async mode
- Priority support
Business
For production workloads
- 10,000 PDFs/month
- All options & formats
- Custom fonts
- Priority support
- Async mode
Scale
High-volume & enterprise use
- 50,000 PDFs/month
- Webhook callbacks
- Bulk API
- Custom fonts
- Priority support
Enterprise
Mission-critical PDF generation
- 200,000 PDFs/month
- SLA guarantee
- Dedicated support
- Webhooks & bulk API
- Custom fonts
- Priority queue
FAQ
Frequently asked questions
Ready to generate your first PDF?
100 PDFs free every month. Try the online playground or integrate the API in minutes.