🧩

Document Convert

Convert between document formats (PDF, DOCX, EPUB, HTML, DOC, RTF, ODT, TXT).

GET 10 credits /v1/convert/document
curl -OJ "https://convert.toolkitapi.io/v1/convert/document?url=https://toolkitapi.io/report.docx&from_format=docx&to_format=pdf"
import httpx

resp = httpx.get(
    "https://convert.toolkitapi.io/v1/convert/document?url=https://toolkitapi.io/report.docx&from_format=docx&to_format=pdf",
)
print(resp.json())
const resp = await fetch("https://convert.toolkitapi.io/v1/convert/document?url=https://toolkitapi.io/report.docx&from_format=docx&to_format=pdf", {
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
Binary document file streamed as a download (Content-Type depends on to_format)

Try It Live

Live Demo

Description

Convert between document formats (PDF, DOCX, EPUB, HTML, DOC, RTF, ODT, TXT).

How to Use

1

1. Host the source document at a public URL (or POST base64 `file` or raw `html`).

2

2. Call with `from_format`, `to_format`, and any format-specific options (`pages`, `dpi`, `page_size`, metadata).

3

3. Save the streamed file, or read `result` from the JSON response on POST.

About This Tool

The unified document endpoint moves between `pdf`, `docx`, `epub`, `html`, `doc`, `rtf`, `odt`, and `txt`, and can also render PDFs as page images (`png`, `jpeg`).

Internally, the service selects the most faithful converter for each format pair — `pandoc` for markup-heavy conversions, `libreoffice` for Office formats, and `pdf2image`/`reportlab` for PDF rendering.

Why Use This Tool

Frequently Asked Questions

What's the highest-fidelity conversion?
Same-family conversions (DOCX ↔ ODT, HTML ↔ Markdown) preserve the most structure. Cross-family (DOCX → EPUB) may flatten some formatting.
Can I watermark the output?
Not via this endpoint. Post-process the returned file with a PDF tooling library.
Are embedded fonts preserved?
Yes for PDF outputs when the source embeds fonts. Otherwise, the closest available font is substituted.

Start using Document Convert now

Get your free API key and make your first request in under a minute.