JavaScript Templating Engines: Which Ones Still Matter in 2026?
Last updated: March 2026
JavaScript Templating Engines in 2026: Which Ones Still Matter?
JavaScript templating engines have been around since the early days of Node.js, and their relevance in 2026 is a genuine question. React, Vue, and Svelte dominate client-side rendering. Server-side rendering frameworks like Next.js and Nuxt handle full-stack needs. So who still uses templating engines, and why?
The answer: millions of developers. EJS alone gets 25 million npm downloads per week. Shopify’s Liquid powers over 4 million storefronts. Pug remains the go-to for teams that despise writing HTML angle brackets. Templating engines thrive where you need server-rendered HTML without the overhead of a full frontend framework — email templates, static site generators, admin panels, CMS themes, and multi-page applications that do not need client-side interactivity.
For broader industry context, see our web development statistics report.
Templating Engine Comparison Table
| Engine | Last Updated | npm Weekly Downloads | Syntax Style | Server / Client | Use Case |
|---|---|---|---|---|---|
| EJS | 2024 | ~25M | Embedded JS (<%= %>) | Both | Express apps, quick server rendering |
| Pug | 2023 | ~6M | Indentation-based (no HTML tags) | Both | Teams who prefer concise markup |
| Handlebars | 2024 | ~12M | Mustache-compatible ({{ }}) | Both | CMS themes, email templates |
| Nunjucks | 2023 | ~2M | Jinja2-like ({% %}) | Both | Static site generators (11ty) |
| Liquid | 2025 | ~800K | Shopify-style ({{ }} / {% %}) | Server | Shopify themes, Jekyll |
| Mustache | 2023 | ~8M | Logic-less ({{ }}) | Both | Simple token replacement, multi-language |
| doT.js | 2021 | ~500K | Custom delimiters ({{ }}) | Both | Performance-critical rendering |
| Eta | 2025 | ~3.5M | EJS-compatible (<%= %>) | Both | Modern EJS replacement, TypeScript-native |
EJS (Embedded JavaScript)
EJS is the most popular templating engine by download count and the default choice for Express.js applications. Its syntax embeds JavaScript directly in HTML using <%= %> for output and <% %> for logic. There is almost no learning curve if you know JavaScript and HTML — the template is just HTML with JavaScript sprinkled in.
EJS compiles templates to plain JavaScript functions, which means excellent runtime performance. It supports partials (<%- include('header') %>), layouts via community packages, and works identically on server and client. The downside: EJS templates can become messy because the syntax encourages mixing logic and presentation. There are no built-in layout or block inheritance features — you need workarounds or plugins for those.
| Strength | Weakness |
|---|---|
| Zero learning curve for JS developers | No built-in layout inheritance |
| Huge ecosystem, tons of tutorials | Easy to write spaghetti templates |
| 25M+ weekly downloads | Last major update 2024 |
| Works with any framework | No compile-time type checking |
Pug (formerly Jade)
Pug replaces HTML’s angle bracket syntax with indentation-based markup. A div.container in Pug compiles to <div class="container"></div>. This brevity appeals to developers who find HTML verbose, and Pug templates are typically 30-40% shorter than equivalent HTML. Pug also includes built-in mixins, template inheritance, conditionals, and iteration — a complete templating toolkit.
The trade-off is readability for newcomers and designers. Anyone comfortable with HTML will find Pug’s syntax foreign. Whitespace sensitivity means indentation errors cause silent rendering bugs. And Pug’s compilation step is noticeably slower than EJS or Handlebars, though this only matters during development with large template sets.
| Strength | Weakness |
|---|---|
| Dramatically less markup to write | Steep learning curve for non-developers |
| Built-in mixins, inheritance, filters | Whitespace-sensitive (indentation bugs) |
| Strong Express.js integration | Slower compilation than alternatives |
| Active community, 6M weekly downloads | Designers cannot edit templates directly |
1. Handlebars

Handlebars extends the Mustache templating language with helpers, partials, and block expressions while maintaining backward compatibility with Mustache templates. Its “logic-less” philosophy keeps templates clean by pushing complex logic into helper functions defined in JavaScript. This separation makes Handlebars templates the most readable option for content-focused rendering.
Handlebars shines in email templating (MJML and many email builders use it), CMS theming (Ghost uses Handlebars), and any context where non-developers need to edit templates safely. The precompilation feature converts templates to JavaScript functions at build time, eliminating runtime parsing overhead.
| Strength | Weakness |
|---|---|
| Clean, readable templates | Limited built-in helpers (needs custom helpers for most logic) |
| Precompilation for performance | Verbose for complex conditionals |
| Safe for non-developer editing | No inline JavaScript expressions |
| Mustache-compatible | Ecosystem feels stagnant compared to newer options |
2. Nunjucks

Nunjucks is Mozilla’s JavaScript port of Python’s Jinja2 templating engine. If you have worked with Django, Flask, or Ansible templates, Nunjucks will feel immediately familiar. It features template inheritance ({% extends %}), blocks, macros, filters, and auto-escaping — a complete feature set that rivals Pug without the custom syntax.
Nunjucks is the default templating engine for Eleventy (11ty), the popular static site generator. This ecosystem connection keeps Nunjucks relevant despite relatively modest standalone download numbers. Its macro system is particularly powerful — you can define reusable template components with arguments, similar to React components but in pure HTML.
3. Liquid

Liquid was created by Shopify and powers every Shopify storefront theme. It also drives Jekyll (GitHub Pages’ default static site generator). Liquid’s distinguishing feature is safety — it is designed to be run on servers with untrusted template code, so it sandboxes template execution and prevents file system access or arbitrary code execution.
For Shopify developers, Liquid is non-negotiable — it is the only way to build themes. Outside Shopify, Liquid competes with Nunjucks and Handlebars for general-purpose server rendering. Its filter-based syntax ({{ "hello" | upcase }}) is intuitive and reads left-to-right, making templates easy to follow even for non-programmers.
4. Mustache

Mustache is the original “logic-less” template engine. It has implementations in over 40 programming languages, making it the best choice when the same template needs to render in JavaScript, Ruby, Python, Go, and other languages. The spec is frozen — Mustache templates written in 2012 work identically today.
Mustache’s simplicity is both its strength and limitation. There are no if/else statements, no loops, no expressions — only sections ({{#list}}...{{/list}}) that iterate arrays or toggle on boolean values. Everything else must be pre-computed in the view model. This forces clean data preparation but frustrates developers who need even basic conditional logic.
5. doT.js
doT.js is the fastest JavaScript templating engine in benchmarks. It achieves this by compiling templates to raw JavaScript functions with minimal overhead — no virtual DOM, no safety wrappers, no helper resolution. If you need to render thousands of templates per second (real-time data dashboards, log viewers, high-frequency server responses), doT.js is measurably faster than alternatives.
The trade-off: doT.js has a minimal feature set, sparse documentation, and has not been actively developed since 2021. It is a surgical tool for performance-critical rendering, not a general-purpose engine. Use it when benchmarks prove other engines are too slow — not as a default choice.
6. Eta
Eta is the modern successor to EJS. It uses the same <%= %> syntax but is written in TypeScript, supports async/await natively, handles layouts and partials without plugins, and weighs just 3.5 KB gzipped (compared to EJS’s 12 KB). Eta is actively maintained in 2025 and adds features EJS lacks: automatic caching, file handling, custom delimiters, and a plugin system.
If you are starting a new project and leaning toward EJS, consider Eta instead. It is a drop-in replacement that handles every EJS use case while adding TypeScript support and better error messages. The migration path from EJS to Eta is straightforward — most templates work without changes.
When to Use a Templating Engine vs React/Vue
This is the question every developer faces in 2026. The answer depends on what your application needs from the browser.
| Scenario | Best Choice | Why |
|---|---|---|
| Content site, blog, documentation | Templating engine (Nunjucks, EJS) | Server-rendered HTML is simpler and faster for read-heavy pages |
| E-commerce storefront | Liquid (Shopify) or templating + HTMX | Server rendering with minimal client JS for speed |
| Admin dashboard with real-time data | React/Vue/Svelte | Complex client-side state management needed |
| Email templates | Handlebars, MJML, EJS | Email clients do not run JavaScript |
| Static site generation | Nunjucks (11ty), Liquid (Jekyll) | Build-time rendering, zero runtime JS |
| Multi-language backend | Mustache | Same templates work in any language |
| Node.js API returning HTML fragments | EJS or Eta | Lightweight, no framework overhead |
| Full SPA with complex interactions | React/Vue/Svelte | Component model, state management, routing |
| Server-rendered app with islands of interactivity | Templating + HTMX or Alpine.js | Server rendering for most pages, JS only where needed |
The resurgence of server-side rendering frameworks like HTMX, Hotwire, and LiveView has actually increased the relevance of templating engines. These tools generate HTML on the server and swap it into the page — exactly what templating engines are built for. An Express + EJS + HTMX stack can build surprisingly interactive applications without a single React component.
Migration Paths
If you are maintaining an older project with one of these engines and considering migration, here is the practical reality of each path.
| From | To | Difficulty | Notes |
|---|---|---|---|
| EJS | Eta | Easy | Drop-in replacement, most templates work unchanged |
| Mustache | Handlebars | Easy | Handlebars is Mustache-compatible |
| Jade | Pug | Trivial | Rename, same syntax |
| Any engine | React/Vue | Full rewrite | Fundamentally different paradigm |
| Nunjucks | Liquid | Moderate | Similar syntax, different filter/tag names |
| Any engine | HTMX + same engine | Low | Add HTMX attributes, keep existing templates |
The Bottom Line
Templating engines are not going away. They serve a different architectural niche than component frameworks, and that niche — server-rendered HTML with minimal client JavaScript — is actually growing thanks to the HTMX and “HTML over the wire” movement. For new projects, Eta is the best general-purpose choice (modern, fast, TypeScript-native). For static sites, Nunjucks with Eleventy is the strongest ecosystem. For Shopify, Liquid is the only option. And for email templates, Handlebars remains the industry standard.
The worst choice is picking a framework like React when a templating engine would suffice. If your page does not need client-side interactivity, server-rendering with a template engine will be faster to build, faster to load, and easier to maintain.
Nunjucks!
👍
Nunjucks FTW! Most flexible templating engine IMHO.
It is sad that NunJucks from Mozilla is not in the list.
Kevin,
Please let us know why you believe NunJucks should be listed there and we’ll make sure to add it once we do the next update for this article.
Because nunjucks is versatile and fast. Really fast. Is running two different projects using handlebars and nunjucks and the difference is remarkable. ☺️
I love https://github.com/webdevelopers-eu/jquery-template
Above all it is non-destructive – you can have UI apply dataset… and then again re-apply new dataset to the same elements to update just some variables… And it has much more. Recursive data sets etc.
TOP 3 from GitHub and Bower
https://github.com/jashkenas/underscore
https://github.com/pugjs/pug
https://github.com/wycats/handlebars.js/
TOP 3 from NpmJs
https://www.npmjs.com/package/underscore
https://www.npmjs.com/package/handlebars
https://www.npmjs.com/package/ejs
Nunjucks is missing
Most of the js template engines are a bit old-fashioned but have a charm on their own. A new player has arrived on the market that makes an use of the new ES6 syntax and is as twice as fast as Pug One of the great things about it is the attempt to mitigate the learning curve of learning new syntax that have scared many developers (like me) away. Have a loot at it here: https://github.com/dondido/express-es6-template-engine
Another vote for express-es6-template-engine – it’s extremely lightweight and blazingly fast. The name is a bit misleading thou. Recently, I’ve switched from express to pure nodejs server and still was able to use it.
I just wanted to write HTML with basic conditionals and template options, but was scared a little by the complexity of a lot of the Express template engines I found, so I made my own 😀
https://www.npmjs.com/package/squirrelly
It works with Express out of the box and is super simple
I believe one of the reasons Handlebars is so “popular” on github and npm is that you require a ton of helpers to do even the simplest of tasks. You can’t even do multiple if:s and === conditions around a node without some helpers.
Why Rivets is not listed, I think it is easier and better than all of these complicated libraries
Java is been a old as well as great platform to start career. It seems you have done good research on java.
Thanks for posting
Javascript is not Java.
yup, …..and you’re replying to bot
Also a huge Nunjucks fan. At least for my email template rendering.
I personally like the Handlebars and jQuery Templating.
So, you give us 14 templating engines to choose from, but seem to market and tout them all without providing any real or tangible reasons why we would favor one over the other. Pros and cons? Github statistics?? Anything to show in some way which ones are more popular, what disadvantages might exist, or something! Instead the reader is left no better than before, wondering which of these 14 options to pick from. 14 is a lot. Unless your whole goal was just to list the template engine in one place, or drive traffic to your website.
Hey there! I just wrote Eta (https://eta.js.org), a more lightweight and faster alternative to EJS. It’s written in TypeScript, adds plugin support, throws great errors, and supports async templates and partials out-of-the-box. It also works with Express by default.