Check the current contract and validator results before you build on this.
JavaScript document libraries split by output format. PptxGenJS is the practical free choice for PPTX, pdfmake/jsPDF/react-pdf cover different PDF models, ExcelJS dominates styled XLSX but still has no chart creation, and the docx package covers Word documents. Carbone and docxtemplater are template-first. Runstamp exposes one operation interface while preserving a format-specific input contract for each named operation.
Use this as a routing page. If you know the output format, go straight to its guide: PowerPoint generation tools, the DOCX package, ExcelJS charts alternatives, or JSON to PPTX.
Overview table
| Library | Primary formats | npm downloads, last week | Best fit | Main limitation |
|---|---|---|---|---|
| PptxGenJS | PPTX | 2.7M | Free JavaScript PowerPoint generation | PPTX only; you own layout logic |
| pdfmake | 2.3M | Declarative JSON-to-PDF | No native charts; table edge cases | |
| jsPDF | 12.7M | Canvas-style PDF drawing | Imperative layout | |
| @react-pdf/renderer | 4.9M | React component PDF generation | PDF only | |
| ExcelJS | XLSX | 12.4M | Styled spreadsheets and streaming writes | No chart creation |
| docx | DOCX | 6.0M | Word documents from TypeScript | Verbose for complex layouts |
| docxtemplater | DOCX, PPTX, XLSX templates | 826K | Filling Office templates with JSON | Template-first workflow |
| Carbone | DOCX, PDF, XLSX, PPTX, more | 20K | Template-based report generation | LibreOffice/template operational model |
| Runstamp | PPTX, PDF, DOCX, XLSX | New packages | Schema-first multi-format generation | Newer ecosystem; server-side |
1. PptxGenJS
PPTX · free · browser + server
PptxGenJS is the most established JavaScript library for generating PowerPoint presentations. It had 2.7 million weekly npm downloads for Jul 26-Aug 1, 2026.
Strengths: Widest chart type support among open-source PPTX libraries (bar, line, pie, scatter, area, doughnut, radar, bubble, combo, 3D). Works in all modern browsers, Node.js, React, Angular, Vite, and Electron. HTML-to-PPTX table conversion. Dual ESM/CJS builds. Only dependency: JSZip. MIT licensed.
Limitations: PPTX only, no PDF, DOCX, or XLSX. Slide animations are explicitly not on the roadmap. Single maintainer (Brent Ely). Some edge cases with repair dialogs in hyperlinked auto-paged tables (fixed in v4.0.1).
Best for: PPTX-only use cases, browser-side generation, teams wanting a free and proven library. For the broader landscape, see PowerPoint generation tools compared.
2. pdfmake
PDF · free · browser + server
pdfmake is a popular JSON-to-PDF library for JavaScript. It had 2.3 million weekly npm downloads for Jul 26-Aug 1, 2026.
Strengths: Declarative JSON API (similar philosophy to Runstamp). Works in both browsers and Node.js. Supports headers, footers, columns, tables of contents, watermarks, and custom fonts. Large community and extensive documentation. MIT licensed.
Limitations: PDF only. No native chart support (images only). Tables wider than the page overflow without warning (issue #441, open since 2015). rowSpan breaks across pages. Images require base64 encoding.
Best for: PDF-only use cases, browser-side PDF generation, teams wanting a free JSON-first library with large community adoption. See Runstamp vs pdfmake for a detailed comparison.
3. ExcelJS
XLSX · free · browser + server
ExcelJS is the most downloaded XLSX writer in this comparison with 12.4 million weekly downloads for Jul 26-Aug 1, 2026
and ~15,400 GitHub stars. It handles cells, formulas, styling, conditional formatting, tables, images, and streaming writes.
Strengths: Rich cell formatting API. Data validation. Streaming writes for large files. Tables with auto-filter. Good TypeScript support. MIT licensed.
Limitations: Zero chart creation support: the feature has been requested since June 2016 (issue #141). If charts are part of the deliverable, start with the ExcelJS chart gap analysis.
Best for: XLSX generation without charts: data exports, spreadsheets with formulas and styling, streaming large datasets. Not suitable for any use case requiring embedded charts.
4. docx
DOCX · free · browser + server
The docx npm package generates Word documents from JavaScript. It had 6.0 million weekly downloads for Jul 26-Aug 1, 2026. The API is builder-pattern based: you construct paragraphs, tables, and sections using objects and helper classes.
Strengths: Clean TypeScript API. Supports headers, footers, page numbers, tables of contents, images, hyperlinks, and bookmarks. Works in browsers and Node.js. MIT licensed.
Limitations: DOCX only. No chart support. No template system: every element must be constructed programmatically. The documentation site has weak SEO presence (low domain authority). The API is verbose for complex layouts.
Best for: DOCX-only generation from code. Contracts, letters, reports, and any document where the content is entirely data-driven. If the same workflow also needs PDF, start with the DOCX package guide and select a separate PDF operation for the PDF-specific input contract.
5. Carbone
15+ formats · paid · server only
Carbone is a template-based document generation platform. Its npm package had 20K weekly downloads for Jul 26-Aug 1, 2026, and the product supports many output formats through a report-generation workflow.
Strengths: Design templates in Word, Excel, or LibreOffice, no code needed for layout. 15+ output formats. Pre-built integrations with Salesforce, HubSpot, Zapier, Make, N8N, Airtable, Bubble. MCP server for AI agents. Excellent customer support (per reviews).
Limitations: Requires LibreOffice for format conversion (Community Edition). Per-document pricing on Cloud plans. Template tag syntax has a learning curve. Server-side only.
Best for: Teams where non-technical users design document templates. Fixed-layout documents (invoices, contracts, certificates). No-code/low-code workflows. See Runstamp vs Carbone.
6. docxtemplater
DOCX, PPTX, XLSX templates · paid modules · browser + server
docxtemplater generates Office documents from templates filled with structured data such as JSON. Its npm package had 826K weekly downloads for Jul 26-Aug 1, 2026.
Strengths: Strong Office-template workflow. Non-developers can own the layout in Word or PowerPoint. Modules add images, charts, HTML, and other advanced template features.
Limitations: It is template-first, not schema-first. If the app needs to invent document structure from data or AI output, you still need a clean intermediate contract. See Runstamp vs docxtemplater.
Best for: Teams with existing Office templates and a clear mail-merge/report-fill workflow.
7. Aspose
20+ formats · paid · server only
Aspose is the enterprise incumbent for document processing. It supports 20+ file formats across .NET, Java, Python, C++, and Node.js. Per-format pricing starts at $1,199/yr
per developer.
Strengths: Every chart type. Every format conversion. 20 years of production use. Enterprise support and SLAs. The most complete document API available.
Limitations: Per-format, per-developer pricing: 4 formats × 5 developers = $23,980/yr. Node.js SDK wraps .NET binaries (50–200 MB per format). Difficult serverless deployment. Separate products for each format.
Best for: Enterprise teams on .NET or Java with budget for per-seat licensing. Regulatory environments with pre-approved vendor lists. Use cases requiring 20+ format coverage. See Runstamp vs Aspose.
8. Runstamp
4 formats · free + paid · server only
Runstamp is a document-processing layer for software products. Its operation interface covers stable creation, reading, change, and check operations through local packages, SDK, CLI, MCP, and Hosted V2. The separate Platform control plane handles self-serve managed execution, review, approval, release, delivery, webhooks, usage, billing, and audit; Pro adds local-production support.
Strengths: One SDK operation interface for format-specific PPTX, PDF, DOCX, and XLSX contracts. Native editable charts in PPTX and XLSX. Pure JavaScript and serverless-compatible packages. MCP server support for AI agents. Combo chart support.
Limitations: Runstamp is newer and has a smaller community than the established SDK vendors in this guide. The stable catalog is available across local packages, SDK, CLI, MCP, and the authenticated Managed API; verify every required job in the current catalog.
Best for: Multi-format generation from application-owned business data, AI agent document workflows, and teams that need PPTX + PDF + DOCX + XLSX through one SDK interface. Each named operation still requires its documented format-specific input. See the SDK quick start and the MCP server docs.
Disclosure: Runstamp is our product. We built it because the four-library stack described in this article, PptxGenJS + pdfmake + docx + ExcelJS, required maintaining four separate codepaths with four separate data transformations for the same report. This article evaluates the libraries on their merits, including Runstamp's limitations.
Decision framework
| If you need... | Use | Why |
|---|---|---|
| PPTX only, free | PptxGenJS | Most practical free JavaScript PowerPoint library |
| PDF only with JSON definitions | pdfmake | Declarative PDF model and large ecosystem |
| React component PDF rendering | @react-pdf/renderer | Fits React mental model |
| XLSX without charts | ExcelJS | Rich cell/formula API and streaming writes |
| XLSX with charts | Runstamp or xlsx-chart | ExcelJS does not create charts |
| DOCX only | docx | Clean TypeScript API for Word files |
| Office templates filled with JSON | docxtemplater or Carbone | Template owner controls layout |
| Enterprise all-format SDK | Aspose | Broadest document API coverage |
| One SDK interface across PPTX, PDF, DOCX, and XLSX | Runstamp | Named operations keep format-specific contracts explicit |
| AI agent document generation | Runstamp | Typed operation boundaries avoid raw OOXML generation |
Keep the document workflow in your product.
Pick an operation, run it on a real file, then embed review and release where your customers work.