Need help with docxtemplater?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

1.8K Stars 272 Forks Other 1.8K Commits 7 Opened issues


Generate docx pptx and xlsx (Microsoft Word, Powerpoint, Excel documents) from templates, from Node.js, the Browser and the command line / Demo:

Services available


Need anything else?

Contributors list

29th January 2021 : A security vulnerability has been found in the npm package : "angular-expressions" that could affect you if you use the angular-parser feature. You should upgrade the angular-expressions package to 1.1.2. See for more details.


Build Status Download count Current tag CDNJS version size gzip size

Browser matrix

docxtemplater logo

docxtemplater is a library to generate docx/pptx documents from a docx/pptx template. It can replace {placeholders} with data and also supports loops and conditions. The templates can be edited by non-programmers, for example your clients.


Demo Site



The full documentation of the latest version can be found on read the docs.

See for information about how to migrate from older versions.

Similar libraries

There are a few similar libraries that work with docx, here’s a list of those I know a bit about:

  • docx4j : JAVA, this is probably the biggest docx library out there. There is no built in templating engine, but you can generate your docx yourself programmatically.
  • docx : Javascript in the browser, you can create your docx from scratch, but not with template syntax, you need to "code your document" in Javascript.
  • redocx : Create Docx document from scratch, using JSX syntax, last commit on December 2018.
  • officegen : works only server side for the moment.


Functionality can be added with modules. Here is the list of existing modules:

PRO Modules developped by docxtemplater core team :

  • Image module to add a given image with the syntax:
  • Html Module to insert formatted text in a docx document.
  • Html-Pptx Module to insert formatted text in a pptx document.
  • Slides Module to create multiple slides dynamically.
  • Subtemplate Module to include an external docx file inside a given docx file.
  • Subsection Module to include subsections (headers/footers) from an other document.
  • Subtemplate-pptx Module to include an external pptx file inside a given pptx file.
  • Word-Run Module to include raw runs () inside the document. This makes it possible to include styled text without having to remove the enclosing paragraph like in the {@rawXml} tag.
  • QrCode Module to replace an image, keeping any existing properties.
  • Error Location Module to show the errors in the template with comments inside the template.
  • Table Module to create tables from two dimensional data.
  • Meta Module to make a document readonly, add a text watermark or update the margins.
  • Styling Module restyle a paragraph, a cell or a table depending on some data.
  • XLSX Module to be able to do templating on Excel files (xlsx extension), also with loops and conditions.
  • Footnotes Module to be able to add footnotes to a document.
  • Paragraph Placeholder Module to simplify conditions that should show or hide a given paragraph.

User-contributed modules :

  • Chart Module using the syntax:
    , user contributed (compatible with v2 only)
  • Hyperlink module using the syntax:
    , (compatible with v2 only)

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.