---
title: "How to build a PowerPoint (PPT/PPTX) viewer in JavaScript"
canonical_url: "https://www.nutrient.io/blog/how-to-build-a-powerpoint-viewer-using-javascript/"
md_url: "https://www.nutrient.io/blog/how-to-build-a-powerpoint-viewer-using-javascript.md"
last_updated: "2026-07-07T19:29:24.091Z"
description: "A step-by-step tutorial explaining how to build a PowerPoint (PPT and PPTX) viewer using JavaScript with the Nutrient SDK."
---

**TL;DR**

This tutorial shows how to build a JavaScript PowerPoint viewer using Nutrient Web SDK to display PPT/PPTX files directly in browsers without server-side processing. The SDK converts Office documents to PDF client-side, enabling features like text editing, annotations, and signatures. Implementation requires installing the SDK via npm, copying assets to your project, adding a container `<div>`, and initializing the viewer with JavaScript. The viewer works without MS Office software or licenses and handles font substitutions automatically.

In this blog post, learn how to build a [JavaScript PowerPoint viewer](https://www.nutrient.io/guides/web/viewer/office-documents.md) using Nutrient Web SDK. You’ll open and view PPT or PPTX files directly in your web browser using client-side processing (no server required).

The image below shows what you’ll be building.![resulting image](@/assets/images/blog/2023/how-to-build-a-powerpoint-viewer-using-javascript/result.png)

You can check out the [demo](https://www.nutrient.io/demo/office-viewer) to see it in action.

## Opening and rendering Office documents in the browser

Nutrient Web SDK brings support for Word, Excel, and PowerPoint formats to your application, without you or your users needing any MS Office software, MS Office licenses, or third-party open source software. The technology works by converting an Office document to PDF directly in the browser, and the document is then rendered in our JavaScript viewer.

For both manual and npm installations, it’s important to note that the assets must be copied to a public folder. Make sure your server has the `Content-Type: application/wasm` MIME type set, as explained in our [troubleshooting](https://www.nutrient.io/guides/web/troubleshooting/common-issues.md#response-has-unsupported-mime-type-error) guide.

To serve the files, you need to use an npm package like [`serve`](https://www.npmjs.com/package/serve) as a simple HTTP server.

## Unlocking more capabilities with Office-to-PDF conversion

By using [Office-to-PDF conversion](https://www.nutrient.io/guides/web/viewer/office-documents.md), you have the option to support a rich array of additional Office document functionality, such as:

- **Text editing** — Edit text directly in the displayed Office document.

- **Page manipulation** — Organize documents by adding, removing, or rearranging pages.

- **Annotations** — Boost collaboration by adding text highlights, comments, or stamps.

- **Adding signatures** — Draw, type, or upload a signature directly to a PowerPoint document.

[Explore Demo](https://www.nutrient.io/demo/office-viewer)

## Requirements to get started

To get started, you’ll need:

- The [latest stable version of Node.js](https://nodejs.org/en/download/package-manager).

- A package manager compatible with [npm](https://docs.npmjs.com/about-npm). This guide contains usage examples for the [npm client](https://docs.npmjs.com/cli/v7/commands/npm) (installed with Node.js by default).

## Adding Nutrient to your project

1. Install the `@nutrient-sdk/viewer` package from `npm`. If you prefer, you can also download Nutrient Web SDK [manually](https://www.nutrient.io/sdk/web/getting-started.md):

```bash

npm install @nutrient-sdk/viewer

```

2. For Nutrient Web SDK to work, it’s necessary to copy the directory containing all the required library files (artifacts) to the `assets` folder. Use the following command to do this:

```bash

cp -R./node_modules/@nutrient-sdk/viewer/dist/./assets/

```

Make sure your `assets` directory contains the `nutrient-viewer.js` file and a `nutrient-viewer-lib` directory with the library assets.

## Integrating into your project

1. Add a PowerPoint document you want to display to your project’s directory. You can use our [demo document](https://www.nutrient.io/downloads/slides.pptx) as an example.

2. Add an empty `<div>` element with a defined width and height to where Nutrient will be mounted:

```html

<div id="pspdfkit" style="width:100%; height: 100vh;"></div>

```

3. Include `nutrient-viewer.js` in your HTML page:

```html

<script src="assets/nutrient-viewer.js"></script>

```

4. Initialize Nutrient Web SDK in JavaScript by calling the `load()` method.

This method takes a [configuration](https://www.nutrient.io/api/web/NutrientViewer.Configuration.html) object as its parameter. The configuration object specifies the location of the document on the page, the path to the source document, and the optional license key:

```html

<script>
	NutrientViewer.load({
		container: "#pspdfkit",

		document: "slides.pptx", // Add the path to your document here.
		licenseKey: "YOUR_LICENSE_KEY", // Remove this line if you're using the free trial.
	})
</script>

```

This code will load `slides.pptx` into the element with the ID `pspdfkit`.

You can see the full `index.html` file below:

```html

<!DOCTYPE html>
<html>
	<head>
		<title>My App</title>
		<!-- Provide proper viewport information so that the layout works on mobile devices. -->

		<meta
			name="viewport"
			content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
		/>
	</head>
	<body>
		<!-- Element where Nutrient will be mounted. -->

		<div id="pspdfkit" style="width:100%; height: 100vh"></div>

		<script src="assets/nutrient-viewer.js"></script>
		<script>
			NutrientViewer.load({
				container: '#pspdfkit',

				document: 'slides.pptx', // Add the path to your document here.
			}).then(function (instance) {
					console.log('Nutrient loaded', instance);
				}).catch(function (error) {
					console.error(error.message);
				});
		</script>
	</body>
</html>

```

## Serving your website

You’ll use the npm `serve` package to serve your project.

1. Install the `serve` package:

```bash

npm install --global serve

```

2. Serve the contents of the current directory:

```bash

serve -l 8080.

```

3. Navigate to http://localhost:8080 to view the website.

<!---

> Interact with the sandbox by clicking the left rectangle icon and selecting Editor > Show Default Layout. To edit, sign in with GitHub — click the rectangle icon again and choose Sign in. To preview the result, click the rectangle icon once more and choose Editor > Embed Preview. For the full example, click the Open Editor button. Enjoy experimenting with the project!

--->

## A note about fonts

When you convert an Office document with custom fonts to a PDF, Nutrient Web SDK might not have access to these fonts due to licensing constraints. In this case, Nutrient typically replaces unavailable fonts with their equivalents — like Arial with Noto.

## Adding even more capabilities

Once you’ve deployed your viewer, you can start customizing it to meet your specific requirements or easily add more capabilities. To help you get started, here are some of our most popular JavaScript guides:

- [Instant synchronization](https://www.nutrient.io/guides/web/instant-synchronization.md)

- [Document assembly](https://www.nutrient.io/guides/web/editor/merge-or-combine.md)

- [Page manipulation](https://www.nutrient.io/guides/web/editor/page-manipulation/rotate.md)

- [Editor](https://www.nutrient.io/guides/web/editor.md)

- [Forms](https://www.nutrient.io/guides/web/forms.md)

- [Signatures](https://www.nutrient.io/guides/web/signatures.md)

- [Redaction](https://www.nutrient.io/guides/web/redaction.md)

- [Document security](https://www.nutrient.io/guides/web/document-security.md)

## Conclusion

In this blog post, you learned how to build a [PowerPoint viewer](https://www.nutrient.io/guides/web/viewer/office-documents.md) using JavaScript with Nutrient Web SDK. It also discussed the benefits of using Nutrient Web SDK to render Office documents in the browser.

If you hit any snags, don’t hesitate to reach out to our [Support team](https://www.nutrient.io/support) for help.

You can also integrate our JavaScript PowerPoint viewer using web frameworks like [Angular](https://www.nutrient.io/guides/web/viewer.md), [Vue.js](https://www.nutrient.io/guides/web/viewer.md), and [React.js](https://www.nutrient.io/guides/web/viewer.md). To see a list of all web frameworks, start your [free trial](https://www.nutrient.io/try/). Or, [launch our demo](https://www.nutrient.io/demo/office-viewer) to see our viewer in action.

## Related reading

- [Open Excel files in the browser using JavaScript](https://www.nutrient.io/blog/how-to-open-excel-file-using-javascript/) — Handle XLS and XLSX files without MS Office

- [How to build a React Word viewer](https://www.nutrient.io/blog/how-to-build-a-react-word-viewer/) — Display DOC/DOCX files in React applications

- [Angular file viewer for PDFs and Office files](https://www.nutrient.io/blog/angular-file-viewer-pdf-image-office-files.md) — Build a multiformat viewer with Angular

- [Top five document viewers for developers](https://www.nutrient.io/blog/top-doc-viewers/) — Compare DOCX and PDF viewer libraries side by side

## FAQ

#### How do I integrate Nutrient Web SDK into my project?

Install the `@nutrient-sdk/viewer` npm package, copy the assets to your project, and load it in your HTML using JavaScript.

#### What formats does Nutrient support?

Nutrient Web SDK supports Word, Excel, and PowerPoint formats by converting them to PDF for display.

#### Do I need a server to run this PowerPoint viewer?

No, the PowerPoint viewer runs completely on the client side, so no server is needed.

#### Can I edit PowerPoint documents directly in the viewer?

Yes, you can add annotations, text, and signatures using the additional features provided by Nutrient.

#### What if my PowerPoint document uses custom fonts?

Nutrient may replace unavailable fonts with alternatives like Noto if it can’t access the original fonts.
---

## Related pages

- [The business case for accessibility: Five ways it drives enterprise value](/blog/5-ways-accessibility-drives-enterprise-value.md)
- [Accessibility Untangled Why It Matters Guide](/blog/accessibility-untangled-why-it-matters-guide.md)
- [Advanced Techniques For React Native Ui Components](/blog/advanced-techniques-for-react-native-ui-components.md)
- [Angular File Viewer Pdf Image Office Files](/blog/angular-file-viewer-pdf-image-office-files.md)
- [Ai Legal Assistant Document Authoring](/blog/ai-legal-assistant-document-authoring.md)
- [Ai Document Automation Extraction To Action](/blog/ai-document-automation-extraction-to-action.md)
- [Auto Tagging And Document Accessibility In Dotnet Sdk](/blog/auto-tagging-and-document-accessibility-in-dotnet-sdk.md)
- [Best Document Viewers](/blog/best-document-viewers.md)
- [The CEO’s AI playbook: Why decision architecture beats model selection](/blog/ceo-ai-playbook-decision-architecture.md)
- [Construction Document Data Extraction](/blog/construction-document-data-extraction.md)
- [Convert One Drive Files To Pdf In Sharepoint](/blog/convert-one-drive-files-to-pdf-in-sharepoint.md)
- [Complete Guide To Pdfjs](/blog/complete-guide-to-pdfjs.md)
- [Create Pdfs With React](/blog/create-pdfs-with-react.md)
- [Create And Edit Pdfs In Flutter](/blog/create-and-edit-pdfs-in-flutter.md)
- [Creating A Document Scanner With Ocr In Python](/blog/creating-a-document-scanner-with-ocr-in-python.md)
- [The CTO’s AI playbook: Why accountability architecture beats orchestration](/blog/cto-ai-playbook-accountability-architecture.md)
- [Digital Signatures](/blog/digital-signatures.md)
- [Document Ai Vs Ocr](/blog/document-ai-vs-ocr.md)
- [Digital Workflow Automation](/blog/digital-workflow-automation.md)
- [Document Viewer](/blog/document-viewer.md)
- [app.py](/blog/extract-text-from-pdf-using-python.md)
- [Emerging threats: Your logging system may be an agentic threat vector](/blog/emerging-threats-your-logging-system.md)
- [How To Build A Dotnet Maui Pdf Viewer](/blog/how-to-build-a-dotnet-maui-pdf-viewer.md)
- [How To Build A Javascript Pdf Viewer](/blog/how-to-build-a-javascript-pdf-viewer.md)
- [or](/blog/how-to-build-a-javascript-pdf-viewer-with-pdfjs.md)
- [How To Build A Flutter Pdf Viewer](/blog/how-to-build-a-flutter-pdf-viewer.md)
- [or](/blog/how-to-build-a-nextjs-pdf-viewer.md)
- [Using Yarn](/blog/how-to-build-a-react-excel-viewer.md)
- [How To Build A Reactjs File Viewer](/blog/how-to-build-a-reactjs-file-viewer.md)
- [How To Build A React Native Pdf Viewer](/blog/how-to-build-a-react-native-pdf-viewer.md)
- [How To Build A React Powerpoint Viewer](/blog/how-to-build-a-react-powerpoint-viewer.md)
- [or](/blog/how-to-build-a-reactjs-pdf-viewer.md)
- [or](/blog/how-to-build-a-reactjs-pdf-viewer-with-react-pdf.md)
- [How To Build A Vuejs Pdf Viewer With Pdfjs](/blog/how-to-build-a-vuejs-pdf-viewer-with-pdfjs.md)
- [How To Build A Reactjs Viewer With Pdfjs](/blog/how-to-build-a-reactjs-viewer-with-pdfjs.md)
- [How To Build A Vuejs Pdf Viewer](/blog/how-to-build-a-vuejs-pdf-viewer.md)
- [How To Build An Android Pdf Viewer](/blog/how-to-build-an-android-pdf-viewer.md)
- [How To Build An Angular Pdf Viewer With Ng2 Pdf Viewer](/blog/how-to-build-an-angular-pdf-viewer-with-ng2-pdf-viewer.md)
- [or](/blog/how-to-convert-html-to-pdf-using-wkhtmltopdf-and-python.md)
- [How To Convert Html To Pdf Using Html2pdf](/blog/how-to-convert-html-to-pdf-using-html2pdf.md)
- [or](/blog/how-to-convert-html-to-pdf-using-react.md)
- [How To Build An Angular Pdf Viewer With Pdfjs](/blog/how-to-build-an-angular-pdf-viewer-with-pdfjs.md)
- [How To Convert Word To Pdf In Nodejs](/blog/how-to-convert-word-to-pdf-in-nodejs.md)
- [How To Create Pdfs With React To Pdf](/blog/how-to-create-pdfs-with-react-to-pdf.md)
- [How To Embed A Pdf Viewer In Your Website](/blog/how-to-embed-a-pdf-viewer-in-your-website.md)
- [How To Generate Pdf From Html With Nodejs](/blog/how-to-generate-pdf-from-html-with-nodejs.md)
- [base_url tells WeasyPrint where to resolve relative asset paths](/blog/how-to-generate-pdf-reports-from-html-in-python.md)
- [How To Edit Pdfs Using Ios Pdf Library](/blog/how-to-edit-pdfs-using-ios-pdf-library.md)
- [From an HTML string.](/blog/html-in-pdf-format.md)
- [Open an image.](/blog/how-to-use-tesseract-ocr-in-python.md)
- [Swift Package Manager](/blog/mobile-pdf-sdk.md)
- [`elements` come from your document parser — each has a type and content.](/blog/multimodal-rag.md)
- [Linearized Pdf](/blog/linearized-pdf.md)
- [Nutrient Vs Conga Composer](/blog/nutrient-vs-conga-composer.md)
- [Pdf Page Labels](/blog/pdf-page-labels.md)
- [Open Pdf In Your Web App](/blog/open-pdf-in-your-web-app.md)
- [Online Document Viewer](/blog/online-document-viewer.md)
- [Pdf Sdk Compliance Security Checklist](/blog/pdf-sdk-compliance-security-checklist.md)
- [Pdf Ua Compliance Guide](/blog/pdf-ua-compliance-guide.md)
- [Pdf Sdk Performance Benchmark](/blog/pdf-sdk-performance-benchmark.md)
- [Pdfjs Area Annotations Canvas Capture](/blog/pdfjs-area-annotations-canvas-capture.md)
- [Pdfjs Annotation Editor Layer](/blog/pdfjs-annotation-editor-layer.md)
- [Pdfjs Eventbus Guide](/blog/pdfjs-eventbus-guide.md)
- [Pdfjs Native Annotation Layer Forms](/blog/pdfjs-native-annotation-layer-forms.md)
- [Pdfjs Limitations Commercial Upgrade](/blog/pdfjs-limitations-commercial-upgrade.md)
- [Pdfjs Coordinate Systems Pdf To Screen](/blog/pdfjs-coordinate-systems-pdf-to-screen.md)
- [Pdfjs Pdf Page Manipulation Pdf Lib](/blog/pdfjs-pdf-page-manipulation-pdf-lib.md)
- [Pdfjs React Viewer Setup](/blog/pdfjs-react-viewer-setup.md)
- [Pdfjs Rendering Overlays React Portals](/blog/pdfjs-rendering-overlays-react-portals.md)
- [Pdfjs Navigation Zoom Rotation](/blog/pdfjs-navigation-zoom-rotation.md)
- [Pdfjs Text Search Pdffindcontroller](/blog/pdfjs-text-search-pdffindcontroller.md)
- [Pdfjs Server Side Text Extraction](/blog/pdfjs-server-side-text-extraction.md)
- [Pdfjs Thumbnail Sidebar](/blog/pdfjs-thumbnail-sidebar.md)
- [Pdfjs Text Highlight Annotations](/blog/pdfjs-text-highlight-annotations.md)
- [Pdfjs Sticky Note Annotations](/blog/pdfjs-sticky-note-annotations.md)
- [Process Flows](/blog/process-flows.md)
- [or](/blog/sample-blog-updated.md)
- [React Native Pdf Annotation](/blog/react-native-pdf-annotation.md)
- [Wcag2 Accessibility Requirements Documents](/blog/wcag2-accessibility-requirements-documents.md)
- [Open an image file.](/blog/tesseract-python-guide.md)
- [Top 5 Javascript Pdf Viewers](/blog/top-5-javascript-pdf-viewers.md)
- [Convert an HTML file to PDF.](/blog/top-ten-ways-to-convert-html-to-pdf.md)
- [Vector Pdf](/blog/vector-pdf.md)
- [Web Sdk Is Now Headless](/blog/web-sdk-is-now-headless.md)
- [What Is A Vpat](/blog/what-is-a-vpat.md)
- [Why Pdfium Is A Trusted Platform For Pdf Rendering](/blog/why-pdfium-is-a-trusted-platform-for-pdf-rendering.md)
- [Why Your Ai Agent Hallucinates Pdf Table Data](/blog/why-your-ai-agent-hallucinates-pdf-table-data.md)
- [What Are Annotations](/blog/what-are-annotations.md)
- [What Is Pdf Ua](/blog/what-is-pdf-ua.md)

