DOCX to PDF API for your application
Send a Word (DOCX) file to a single endpoint and get the PDF back in the response, with fonts, tables, images, headers and footers kept. Authentication by API key, usage counted in credits, plans from €9.90 per month.
What the DOCX to PDF API does
/api/convertThe API exposes one endpoint: POST /api/convert. You send the DOCX as multipart/form-data in a field named file, with your API key in the Authorization header. The response is the PDF itself, as binary data with Content-Type: application/pdf, so you can write it to disk, stream it to your user or store it where you like.
Three response headers tell you where you stand: X-Credits-Used (credits consumed by this call), X-Credits-Remaining (credits left this month) and X-Credits-Limit (your monthly allowance). The conversion is the same as the one behind the online converter: the layout of the Word document is kept.
A first conversion from the command line:
curl -X POST https://www.hellodocxtopdf.com/api/convert \
-H "Authorization: Bearer hpdf_your_api_key" \
-F "file=@document.docx" \
-o output.pdfAuthentication by API key
Every request must carry an API key in the Authorization header, as a Bearer token. Keys are created and managed in the Credentials section of your dashboard once you have subscribed to a plan. A request without a valid key gets a 401 response.
Authorization: Bearer hpdf_your_api_keyCredits and plans
Usage is counted in credits: 1 credit per 5 MB of file size, rounded up. A 3 MB document costs 1 credit, an 8 MB document 2 credits, a 13 MB document 3 credits. Credits reset every month and unused credits do not roll over.
| Plan | Price | Credits per month | Max file size |
|---|---|---|---|
| Starter | €9.90/month | 100 | 25 MB |
| Pro | €19.90/month | 1,000 | 50 MB |
| Enterprise | €99.90/month | 10,000 | 100 MB |
When the credits are exhausted the API answers 429 with a JSON body giving creditsNeeded, creditsRemaining, creditsLimit and resetAt, so your integration can wait or upgrade. The full detail of each plan is on the pricing page.
See plans and pricingExample: convert a DOCX from JavaScript
const formData = new FormData();
formData.append('file', docxFile);
const response = await fetch('https://www.hellodocxtopdf.com/api/convert', {
method: 'POST',
headers: {
'Authorization': 'Bearer hpdf_your_api_key'
},
body: formData
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.message);
}
const pdfBlob = await response.blob();
const pdfUrl = URL.createObjectURL(pdfBlob);
// Download the PDF
const link = document.createElement('a');
link.href = pdfUrl;
link.download = 'document.pdf';
link.click();Python and Node.js examples, the list of status codes and the error format are in the full API documentation.
Read the full API documentationWhat developers use the DOCX to PDF API for
Document generation
Fill a Word template (contract, invoice, letter, certificate) from your data, then call the API to deliver a PDF to your customer, with the layout designed in Word.
Archiving
Convert documents to PDF as they are received or finalised, so they can be read in years without Word and stored in a fixed format.
Batch conversion
Loop over a folder or a database of DOCX files from a script: each call returns one PDF, and the credit headers let you follow consumption.
Export from your app
Let users of your web or back-office application download a PDF of a document your application produced as DOCX, without installing Word on your servers.
DOCX to PDF API: frequently asked questions
Is the API available on the free plan?
No. API access is included in the paid plans: Starter (€9.90/month), Pro (€19.90/month) and Enterprise (€99.90/month). The free converter on the home page is for manual use, one file at a time.
Which formats does the API accept?
DOCX files only (Word 2007 and later). Other formats such as DOC or ODT are rejected with a 400 error; convert them to DOCX first.
How large can a file be?
It depends on your plan: 25 MB on Starter, 50 MB on Pro, 100 MB on Enterprise. A larger file gets a 400 error.
What happens to the files sent to the API?
The same as for the online converter: the transfer is encrypted with SSL/TLS, the original DOCX is deleted immediately after conversion, and nothing is stored.
How are credits counted?
1 credit per 5 MB of the uploaded file, rounded up. Each response carries the X-Credits-Used, X-Credits-Remaining and X-Credits-Limit headers; credits reset monthly.
Where do I find my API key?
In the Credentials section of your dashboard, after subscribing to a paid plan. You can create and manage several keys there.
Go further
Two guides from our blog, plus the full documentation and pricing.