Every developer has been there: you need to convert a Word doc to Markdown, a PDF to HTML, or generate a nicely formatted PDF from your app. You spin up a server, install Pandoc, write a wrapper script, and suddenly you're maintaining infrastructure just to transform documents.
Stop building document conversion infrastructure.
This is a hosted Pandoc API that handles the heavy lifting—so you can focus on your actual product.
- Simple setup – Deploy once, convert documents via a clean REST API.
- Format agnostic – Convert between Markdown, HTML, PDF, DOCX, LaTeX, and 40+ other formats.
- Fast & reliable – Runs on Bun's high-performance runtime.
- API-first – Simple REST endpoints with full OpenAPI documentation.
Convert documents like you would call any other API. No Pandoc installation required.
Quick Links
- code - https://github.com/david1gp/pandoc
- npm - https://www.npmjs.com/package/@adaptive-ds/pandoc
- pandoc manual - https://pandoc.org/MANUAL.html
- pandoc web - https://pandoc.org/app/
- Convert documents between 40+ formats (Markdown, HTML, PDF, DOCX, LaTeX, EPUB, etc.)
- Two conversion methods:
- From URL – Provide a publicly accessible file URL
- From File – Send base64-encoded file content directly
- Full OpenAPI/Swagger documentation built-in
- Type-safe client libraries for easy integration
The service runs on Bun, a fast JavaScript runtime:
Your App → Bun Server → Pandoc Engine → Converted Output → Your App
- Bun runtime installed
- Pandoc installed on the host machine
- A VPS or server to host the service
-
Clone the repository
-
Install dependencies:
bun install -
Run the development server:
bun run dev -
Visit
http://localhost:3000for the Swagger UI
curl -X POST "http://localhost:3000/api/pandoc/from-url" \
-H "Content-Type: application/json" \
-d '{
"inputUrl": "https://example.com/document.docx",
"inputFormat": "docx",
"outputFormat": "markdown"
}'curl -X PUT "http://localhost:3000/api/pandoc/from-file" \
-H "Content-Type: application/json" \
-d '{
"fileBase64": "$(base64 -w0 document.docx)",
"inputFormat": "docx",
"outputFormat": "markdown"
}'docx, odt, rtf, epub, pdf, html, json, markdown, asciidoc, and more
markdown, html, pdf, docx, odt, latex, beamer, epub, asciidoc, and more
See the Pandoc manual for the full list of supported formats.
-
Install dependencies:
bun install -
Ensure Pandoc and TeX Live are installed on your server:
pandoc --versionTeX Live is required for PDF output. Install via your package manager:
- Ubuntu/Debian:
apt install texlive-latex-base - Fedora/RHEL:
dnf install texlive-latex-base - macOS:
brew install --cask mactexortexlive-latex-base - Arch:
pacman -S texlive-core
- Ubuntu/Debian:
-
Run in production:
bun run start -
Use a process manager (systemd, PM2, etc.) to keep it running:
- Input validation on all endpoints
- No sensitive data is logged or exposed
- Rate limiting recommended at the proxy/load balancer level
- Base64 input prevents direct file system access
MIT License - use it freely in your projects!