PptxGenJS lets you generate professional PowerPoint presentations in JavaScript - directly from Node, React, Vite, Electron, or even the browser. The library outputs standards-compliant Open Office XML (OOXML) files compatible with:
- β Microsoft PowerPoint
- β Apple Keynote
- β LibreOffice Impress
- β Google Slides (via import)
Design custom slides, charts, images, tables, and templates programmatically - no PowerPoint install or license required.
- Supports every major modern browser - desktop and mobile
- Seamlessly integrates with Node.js, React, Angular, Vite, and Electron
- Compatible with PowerPoint, Keynote, LibreOffice, and other OOXML apps
- Create all major slide objects: text, tables, shapes, images, charts, and more
- Define custom Slide Masters for consistent academic or corporate branding
- Supports SVGs, animated GIFs, YouTube embeds, RTL text, and Asian fonts
- Ridiculously easy to use - create a presentation in 4 lines of code
- Full TypeScript definitions for autocomplete and inline documentation
- Includes 75+ demo slides covering every feature and usage pattern
- Instantly download
.pptxfiles from the browser with proper MIME handling - Export as base64, Blob, Buffer, or Node stream
- Supports compression and advanced output options for production use
This NEOMA-maintained fork (@neoma/pptxgenjs) is hardened for production use:
- Strict null-safety - the entire source compiles under TypeScript
strictNullCheckswith zero non-null assertions (!) and zero uncheckedascasts; null-safety is enforced through honest types, guard clauses, and validated defaults - Tested in CI - unit, end-to-end, and golden-file OOXML snapshot tests run on Node.js 20 & 22
- Secure - no known vulnerabilities in the published package, CodeQL scanning, and a published security policy
- Requires Node.js 20+ (see
CONTRIBUTING.mdto build and test locally)
- Convert any HTML
<table>to one or more slides with a single line of code β Explore the HTML-to-PPTX feature
Choose your preferred method to install PptxGenJS:
npm install @neoma/pptxgenjsyarn add @neoma/pptxgenjsPptxGenJS works seamlessly in modern web and Node environments, thanks to dual ESM and CJS builds and zero runtime dependencies. Whether you're building a CLI tool, an Electron app, or a web-based presentation builder, the library adapts automatically to your stack.
- Node.js β generate presentations in backend scripts, APIs, or CLI tools
- React / Angular / Vite / Webpack β just import and go, no config required
- Electron β build native apps with full filesystem access and PowerPoint output
- Browser (Vanilla JS) β embed in web apps with direct download support
- Serverless / Edge Functions β use in AWS Lambda, Vercel, Cloudflare Workers, etc.
Vite, Webpack, and modern bundlers automatically select the right build via the
exportsfield inpackage.json.
- CommonJS:
dist/pptxgen.cjs.js - ES Module:
dist/pptxgen.es.js
PptxGenJS PowerPoint presentations are created via JavaScript by following 4 basic steps:
import pptxgen from "@neoma/pptxgenjs";
// 1. Create a new Presentation
let pres = new pptxgen();
// 2. Add a Slide
let slide = pres.addSlide();
// 3. Add one or more objects (Tables, Shapes, Images, Text and Media) to the Slide
let textboxText = "Hello World from PptxGenJS!";
let textboxOpts = { x: 1, y: 1, color: "363636" };
slide.addText(textboxText, textboxOpts);
// 4. Save the Presentation
pres.writeFile();// 1. Create a new Presentation
let pres = new PptxGenJS();
// 2. Add a Slide
let slide = pres.addSlide();
// 3. Add one or more objects (Tables, Shapes, Images, Text and Media) to the Slide
let textboxText = "Hello World from PptxGenJS!";
let textboxOpts = { x: 1, y: 1, color: "363636" };
slide.addText(textboxText, textboxOpts);
// 4. Save the Presentation
pres.writeFile();That's really all there is to it!
Convert any HTML <table> into fully formatted PowerPoint slides - automatically and effortlessly.
let pptx = new pptxgen();
pptx.tableToSlides("tableElementId");
pptx.writeFile({ fileName: "html2pptx-demo.pptx" });Perfect for transforming:
- Dynamic dashboards and data reports
- Exportable grids in web apps
- Tabular content from CMS or BI tools
Read the HTML to PowerPoint guide
Complete API reference, tutorials, and integration guides are available on the docs site: https://neomaverwaltung.github.io/PptxGenJS
The docs are plain markdown under docs/ and build with VitePress (npm run docs:dev to preview locally); they deploy to GitHub Pages automatically on push to master.
Please file issues or suggestions on the issues page on github, or even better, submit a pull request. Feedback is always welcome!
When reporting issues, please include a code snippet or a link demonstrating the problem. Here is a small jsFiddle that is already configured and uses the latest PptxGenJS code.
Sometimes implementing a new library can be a difficult task and the slightest mistake will keep something from working. We've all been there!
If you are having issues getting a presentation to generate, check out the code in the demos directory. The
Node demo (demos/node) contains working examples of every available library feature.
- Use a pre-configured jsFiddle to test with: PptxGenJS Fiddle
- View questions tagged
PptxGenJSon StackOverflow. If you can't find your question, ask it yourself - be sure to tag itpptxgenjs. - Ask your AI pair programmer! All major LLMs have ingested the pptxgenjs library and have the ability to answer functionality questions and provide code.
Thank you to everyone for the contributions and suggestions! β€οΈ
Special Thanks:
- Dzmitry Dulko - Getting the project published on NPM
- Michal KacerovskΓ½ - New Master Slide Layouts and Chart expertise
- Connor Bowman - Adding Placeholders
- Reima Frgos - Multiple chart and general functionality patches
- Matt King - Chart expertise
- Mike Wilcox - Chart expertise
- Joonas - react-pptx
PowerPoint shape definitions and some XML code via Officegen Project
If you find this library useful, consider contributing to open-source projects, or sharing your knowledge on the open social web. Together, we can build free tools and resources that empower everyone.
Copyright Β© 2015-present Brent Ely, Β© 2026-present NEOMA GmbH
