Comparison Guide

Best HTML to PDF API in 2026

Generating PDFs from HTML is one of the most common backend tasks — and one of the most frustrating to get right. Here's how the top tools compare on CSS support, pricing, and developer experience.

FeatureRenderfyPuppeteerwkhtmltopdfDocRaptorPDFShift
CSS engineChromiumChromiumQt WebKitPrinceXMLChromium
Flexbox / GridYesYesNoPartialYes
Input typesHTML, Tailwind, MD, code, charts, diagrams, mathAny (DIY)HTMLHTMLHTML
Image output tooPNG, JPEG, WebPPNG, JPEG, WebPPNG, SVGNoNo
Saved templatesYesDIYNoNoNo
Batch renderingUp to 20/callDIYNoNoNo
Custom fontsGoogle Fonts by nameAny (local)System fontsCSS @font-faceCSS @font-face
Managed serviceYesNo (self-hosted)No (CLI)YesYes
Starting price$9/moFree + infraFree (archived)$15/mo$9/mo
1.

Renderfy

Best all-in-one rendering API with PDF + image output

A single REST endpoint that converts HTML, Tailwind CSS, Markdown, code, charts, diagrams, and LaTeX math to PDF (or PNG/JPEG/WebP). PDFs are rendered by a managed headless Chromium instance — full CSS support including flexbox, grid, CSS variables, and @media print. Returns the PDF binary directly in the response. Includes saved templates, batch rendering, and idempotent retries.

Pros

  • Full CSS support — flexbox, grid, CSS variables, @media print
  • 7 input types (HTML, Tailwind, Markdown, code, charts, diagrams, math)
  • Binary response — PDF returned directly, no hosted URL
  • Saved templates with {{ placeholder }} substitution
  • Batch rendering (up to 20 per call) and idempotent retries
  • Custom brand fonts by Google Font family name
  • Same API for images and PDFs — one integration for both
  • EU data residency

Cons

  • PDF costs 3 credits vs 1 for images
  • Managed API only — no self-hosted option

Pricing: 100 free credits on signup (no card). PDFs cost 3 credits each. Paid plans from $9/mo (5,000 credits).

2.

Puppeteer / Playwright (self-hosted)

Best if you want full control and own your infra

Open-source headless Chrome automation. page.pdf() generates PDFs with full Chromium rendering. Free — you manage the infrastructure. Actively maintained (Puppeteer v25+, Playwright regularly updated).

Pros

  • Free and open-source
  • Full Chromium CSS support
  • Complete control over headers, footers, margins, page breaks
  • Can combine with other browser automation (screenshots, scraping)

Cons

  • You manage Chrome instances, memory, and concurrency
  • Cold starts on serverless are slow (500ms–3s)
  • No built-in template system, batch API, or idempotency
  • Every feature (fonts, retries, scaling) is DIY

Pricing: Free (open-source). You pay for compute infrastructure.

3.

wkhtmltopdf

Legacy tool — avoid for new projects

Command-line tool that converts HTML to PDF using the Qt WebKit engine. Last release was 0.12.6 in June 2020; the GitHub repository was archived in January 2023. No flexbox, no grid, no CSS variables.

Pros

  • Fast — no full browser to spin up
  • Simple CLI interface
  • Free and open-source

Cons

  • Archived — no longer maintained (last release 2020)
  • Qt WebKit engine — no flexbox, grid, or CSS variables
  • No API — CLI only, requires wrapping in your own service
  • Rendering differences from modern browsers

Pricing: Free (open-source, archived).

4.

DocRaptor

Best for complex print layouts (PrinceXML engine)

Managed API powered by PrinceXML — a dedicated PDF rendering engine (not browser-based). Excellent support for print CSS: page breaks, running headers/footers, footnotes, cross-references, and advanced typography. Best-in-class for book-quality PDF output.

Pros

  • PrinceXML engine — best print CSS support available
  • Running headers/footers, footnotes, cross-references
  • Mature, reliable service (10+ years)
  • Excel output alongside PDF

Cons

  • Not browser-based — some CSS that works in Chrome may not render
  • Starts at $15/mo for 125 documents
  • No image output (PDF and Excel only)
  • No Tailwind, Markdown, or chart input

Pricing: Free test documents (watermarked). Paid from $15/mo (125 docs) to $299/mo (10,000 docs).

5.

PDFShift

Focused and affordable for simple HTML-to-PDF

Managed API focused exclusively on HTML to PDF conversion. Clean REST API with support for headers/footers, watermarks, and CSS @media print. Uses headless Chrome under the hood.

Pros

  • Simple, focused API — HTML to PDF only
  • Full Chrome CSS support
  • Headers, footers, watermarks built-in
  • Affordable starting price

Cons

  • PDF only — no image output
  • No Tailwind, Markdown, chart, or code input
  • No saved templates or batch rendering
  • No idempotency or retry protection

Pricing: 50 free conversions. Paid from $9/mo (500 conversions).

Frequently asked questions

What is an HTML to PDF API?

An HTML to PDF API takes HTML (and usually CSS) as input and returns a rendered PDF document. Instead of using a print dialog or a command-line tool, you send a POST request and get a publication-ready PDF back — useful for invoices, reports, certificates, and documentation.

Which HTML to PDF API has the best CSS support?

APIs that use headless Chromium (Renderfy, Puppeteer, PDFShift) have the best general CSS support — flexbox, grid, CSS variables, @media print all work. DocRaptor uses PrinceXML which has better print-specific CSS (running headers, footnotes) but less support for modern layout. wkhtmltopdf uses Qt WebKit and lacks flexbox/grid entirely.

Is wkhtmltopdf still maintained?

No. The last release was 0.12.6 in June 2020 and the GitHub repository was archived in January 2023. It uses the Qt WebKit engine which doesn't support modern CSS like flexbox or grid. For new projects, use a Chromium-based tool instead.

Can I generate both images and PDFs from the same API?

Yes — Renderfy handles both from a single endpoint. Send the same HTML with format: 'pdf' for a PDF or format: 'png' for an image. Most other PDF tools (DocRaptor, PDFShift, wkhtmltopdf) only output PDF.

100 free credits — generate PDFs and images from one API

HTML, Tailwind, Markdown, code, charts, diagrams, math — same endpoint, same syntax.

Get your API key