“Best html to pdf api” is a search that usually dumps you into a scorecard with stars nobody measured and latency numbers nobody published. This is not that. It is a short map of seven public APIs that actually convert HTML (or a URL) to PDF, what they run under the hood, and when each one is the boring, correct choice.
Disclosure, up front: we make RelayPDF. It is listed because it is a hosted HTML-to-PDF API, not as a trophy. Existing compare pages are linked; we do not invent missing ones. No benchmarks. Any number is from that vendor’s public site as of research.
What “best” actually means here
HTML-to-PDF is not one product. It is at least three different jobs wearing the same name:
- Render a modern webpage (flex, grid, webfonts, a chart that paints after a fetch) into pages. That is a browser.
- Typeset a print document (footnotes, running heads, named pages, CSS Paged Media that Chromium still treats as a suggestion). That is closer to a typesetter.
- Convert whatever landed in an upload slot — HTML today, a DOCX tomorrow — and maybe merge the result. That is a document pipeline.
Pick the engine that matches the job, then decide whether you want to operate it. Self-hosting is not free just because the container is. A hosted API is not “simple” if the request model fights your stack.
The list, in a table
Neutral columns only: who they are, what they render with, how you talk to them, how they bill (as they describe it), and a one-line “use when.” No scores.
| API | Engine (public) | Hosting | Billing model (public) | Use when |
|---|---|---|---|---|
| RelayPDF | Chromium for /v1/pdf; LibreOffice / wkhtmltopdf on /v1/convert | Managed SaaS | Prepaid wallet; $5 trial credit; listed HTML→PDF price $0.015/render | You want a hosted Chromium POST plus Office/tools/CLI/MCP |
| PDFShift | Chromium (their site: “powered by Chromium”) | Managed SaaS | Credits; free 50 credits/mo; paid plans from $9/mo | You want a focused HTML/URL → PDF/image API with S3/GCS export |
| DocRaptor | Prince (PrinceXML) | Managed SaaS | Monthly document quotas; free plan 5 docs/mo; paid from $15/mo; unlimited watermarked tests | You need CSS Paged Media, tagged/accessible PDFs, or print-style layout Prince is built for |
| Gotenberg | Headless Chromium + LibreOffice (Docker image) | Self-hosted (they warn: do not expose to the public internet) | Software is free; you pay for machines and ops | Data stays in your VPC and you will run a Chromium/LibreOffice stack |
| API2PDF | Headless Chrome, wkhtmltopdf, LibreOffice (they name the engines) | Managed, serverless REST | Pay-as-you-go: $1/mo base + bandwidth + compute (their pricing page) | You want engine choice and Office/merge without monthly volume tiers |
| CloudConvert | Headless Chrome for HTML/URL capture; broader convert job graph | Managed SaaS | Credits (time + type); free 10/day; packages and subscriptions | HTML→PDF is one step in a multi-format job, often with object storage |
| Adobe PDF Services | Adobe’s HTML-to-PDF operation (HTML, zip, URL) | Managed Adobe cloud | Document transactions; docs mention a free tier of 500 transactions/month | You already live in Adobe Acrobat Services and need the rest of that API surface |
RelayPDF
We ship a managed API: POST /v1/pdf takes HTML, a public URL, Markdown, or a published Handlebars template and returns a Chromium PDF. Same key covers screenshots, LibreOffice/wkhtml convert, merge/extract/protect, barcodes, zip, async jobs, and a CLI/MCP surface. Docs live at relaypdf.com/docs.
Public facts we publish: bearer keys only (no query-string keys), 24-hour file retention, body contents not logged, failed jobs unbilled, $5 trial credit, $0.015 per HTML→PDF on the homepage, 15 MB cap on PDF tool inputs. Those are ours, not third-party measurements.
If you are comparing us to a specific vendor we already wrote up, use those pages rather than this list: vs PDFShift, vs DocRaptor, vs Gotenberg. Index: /compare. Compare pages also exist for API2PDF, CloudConvert, Adobe PDF Services, and WeasyPrint.
PDFShift
PDFShift is a hosted HTML-to-* API. Docs list PDF, PNG, JPEG, and WebP, templates, and export to S3 or GCS. The site says Chromium, CSS/JS injection, headers/footers, encryption, watermarks, sandbox mode, and webhooks. Credits: 50 free/month, paid from $9/mo (500 credits), one credit per conversion up to 5 MB. Homepage speed claims are marketing, not a contract.
Choose it when the product is “turn this page into a PDF or a screenshot and maybe drop it in a bucket.” Their public surface is narrower than a full document toolkit and that is not an insult.
DocRaptor
DocRaptor is the hosted Prince API. Prince is not a browser. It is a CSS-to-PDF engine with a long history in print CSS, and DocRaptor’s own site leans on that: CSS Paged Media, footnotes, page floats, named pages, accessible/tagged PDFs, PDF forms, 99.99% uptime claim, SOC 2 and HIPAA. JavaScript is opt-in; their API reference documents a custom JS engine and Prince’s own JS, both off by default.
Plans are document quotas (free: 5/month; Basic $15/mo for 125; up through high-volume and enterprise). Test documents are unlimited and watermarked. They price by document, not by page count or file weight — they say that explicitly.
Pick Prince when the HTML is a contract, book, or anything that needs running heads and footnotes Chromium print CSS still mishandles. If the HTML is a React invoice that assumes CSS Grid and a modern JS runtime, check Prince’s current CSS support yourself. We will not invent a Grid verdict.
Gotenberg
Gotenberg is a Docker API, not a SaaS. Official image gotenberg/gotenberg:8 wraps Chromium and LibreOffice and speaks multipart form-data. HTML conversion wants a file named index.html plus flat sibling assets. URL and Markdown routes exist. There is also merge/split/encrypt/watermark, screenshots, and PDF/A / PDF/UA via the PDF engines they ship.
Install docs: do not expose it on the public internet; treat it like a database. There is a demo host. There is no vendor invoice — only your machines. That is the right pick when residency matters and you already operate containers.
API2PDF
API2PDF’s homepage is unusually explicit about engines: Headless Chrome, wkhtmltopdf, LibreOffice, plus merge, barcodes, thumbnails, screenshots. v2 lives at v2.api2pdf.com; Chrome HTML-to-PDF is POST /chrome/pdf/html with an Authorization header. Pricing (their page): $1/month plus bandwidth and compute, no volume tiers. They advertise no request-queue story and large-file support. We did not independently verify concurrency or file-size claims.
Use it when you want those named engines behind one key and you prefer metered compute to a monthly document bucket. It is a conversion API, not a template studio.
CloudConvert
CloudConvert is a job graph that happens to include HTML. capture-website takes a URL (or you import an HTML file) and can emit PDF or a screenshot, with Chrome called out on their HTML-to-PDF product page. Jobs chain import → convert/capture → export, including S3, Azure, and GCS. Sync and async endpoints both exist.
Credits: free tier is 10 conversions/day on the pricing page. Packages do not expire; subscriptions reset monthly. They charge a base credit by conversion type (general 1, Office→PDF 2, PDF→Office 4) plus time (typically one credit per minute after the first). Only successful conversions are billed, per their FAQ.
If HTML-to-PDF is 10% of a converter that also eats video and Office, this is the grown-up choice. If you only ever POST HTML, you will pay for a more general machine than you need.
Adobe PDF Services
Adobe’s HTML to PDF operation is one method on PDF Services: static/dynamic HTML, a zip (index.html plus assets), or a URL. Auth is an Adobe developer app — x-api-key plus a bearer token — not a single long-lived PDF key you paste into curl and forget. Official SDKs: Node, Java, .NET, Python. Their overview docs state a free tier of 500 document transactions per month.
The rest of the suite is the reason enterprises pick it: create-from-Office, protect, compress, extract, accessibility tagging. HTML-to-PDF here is a feature, not the company. Onboarding and IAM look like Adobe, because they are.
How to choose without a leaderboard
Start with the engine. Chromium if the source is a webpage. Prince if the source is a print document and you will write @page CSS. LibreOffice if someone will upload a .docx next week and you do not want a second vendor.
Then hosting. Gotenberg if you will patch Chromium and keep the port off the internet. Everyone else if you want someone else paged when the renderer wedges.
Then the request shape. JSON body with html (RelayPDF, PDFShift, API2PDF Chrome) versus multipart files (Gotenberg) versus a job of named tasks (CloudConvert) versus asset upload + OAuth (Adobe). Mismatch here costs more engineering time than a 0.2¢ difference on a pricing table.
Then money, using their units, not ours: wallet cents, credits per 5 MB, documents per month, credits per minute, compute-seconds, Adobe transactions. Converting those into one “cost per PDF” column would be fan fiction unless you fix page weight, JS wait, and failure rate. We will not.
What this list refuses to do
No star ratings. No “winner.” No latency table. No market-share claim. Vendor uptime percentages appear only where the vendor prints them (DocRaptor’s 99.99% guarantee; CloudConvert lists a 99.9% SLA on paid enterprise-shaped plans). Those are promises, not our measurements.
If you want the pairwise version of us versus a Chromium host, a Prince host, or a Docker host, the compare pages above exist for that. This post is the index, not the verdict.