CodeeoInsightsWeb Development

Node.js vs Express.js: Runtime vs Framework Explained

Node.js runs JavaScript on the server; Express adds routing and middleware on top. Here is how they differ, what Express 5 changed and which Node.js version to use.

Node.js and Express logos

Node.js vs Express.js is not a choice between two rivals. Node.js is the runtime that executes JavaScript on a server, and Express.js is a small web framework that runs on top of Node.js to handle routes, requests and responses. Every Express app is a Node.js app, but not every Node.js app needs Express.

This guide explains what each one does, where the line between them sits, what changed with Express 5, and which Node.js version to run in late 2026. Versions are current as of October 2026.

Node.js vs Express.js at a glance

FactorNode.jsExpress.js
What it isJavaScript runtimeWeb framework for Node.js
JobRuns JavaScript outside the browserRoutes HTTP requests to your code
Can run aloneYesNo, it needs Node.js
Used forServers, CLIs, scripts, workers, build toolsWeb apps and APIs
HTTP handlingLow level http moduleRouting, middleware, helpers
Current line24 LTS, 26 Current5.x (5.3.0)
Learn first?YesAfter Node.js basics

The common analogy holds up: Node.js is the engine, Express is the steering and controls. You can build a car around the engine yourself, but most teams would rather not.

What Node.js is

Node.js is an open source, cross-platform runtime that lets you run JavaScript on servers, desktops and build machines instead of only in a browser. It uses Google's V8 engine and a non-blocking, event-driven I/O model. In practice that means one Node.js process can keep many network connections open at once, because it does not sit idle while it waits for a database query or a file read to finish.

Why teams pick Node.js

  • One language across the stack. Front-end and back-end developers both write JavaScript or TypeScript, so code, types and validation rules can be shared.
  • Strong at I/O heavy work. APIs, real-time chat, notifications, streaming and proxy services spend most of their time waiting on networks, which is where the event loop shines.
  • The npm ecosystem. Most problems already have a maintained package, from database drivers to payment SDKs.
  • More built in than before. Modern Node.js ships a global fetch (stable since v21), a stable test runner in node:test (stable since v20), and native TypeScript type stripping, which is on by default and was marked stable in v24.12.0. Details are in the Node.js TypeScript docs.

Where Node.js is a weaker fit

Long, CPU bound jobs such as video encoding or heavy number crunching block the event loop and slow every other request. You can move them to worker threads or a separate service, but if most of your workload is computation rather than I/O, another runtime may suit you better.

What Express.js is

Express is a minimal web framework built on Node.js. Node's own http module gives you a raw request and response and leaves the rest to you: parsing URLs, matching paths, reading request bodies, setting headers. Express wraps that in a small, predictable set of tools.

Routing

You map an HTTP method and a path, such as GET on /orders/:id, to a handler function. Express parses the path parameters for you and keeps related routes together in routers, which keeps a growing codebase organised.

Middleware

Middleware functions run in order between the incoming request and your final handler. They are where you put authentication, logging, JSON body parsing, CORS rules and rate limiting. Most of what makes Express useful comes from this one idea and the large number of middleware packages written for it.

Static files and templates

express.static serves CSS, JavaScript and images from a folder without extra code. Express also plugs into template engines such as EJS and Pug when you render HTML on the server rather than in a front-end framework.

What Express does not do

Express is deliberately unopinionated. It has no built-in database layer, validation, dependency injection or project structure. That freedom suits small services and experienced teams, but on a large codebase every team ends up inventing its own conventions.

The real difference: runtime vs framework

The clearest way to see the Node.js vs Express.js split is to look at what you write without Express. With plain Node.js you create a server with the http module, then inspect req.url and req.method yourself, split the path, collect the body in chunks, parse JSON and set every header by hand. That is fine for a health check endpoint or a webhook receiver with one route. Past a handful of routes it turns into a hand-built framework.

Express does that groundwork once, in a well tested way, and adds very little on top. You still need to understand Node.js underneath it: the event loop, streams, error handling and async code all behave exactly as they do in plain Node.js. That is why the usual advice for new developers is to learn Node.js fundamentals first, then pick up Express.

Express 5: what changed

Express 5.0 was published to npm in September 2024, about ten years after Express 4 first shipped, and the 5.x line is now the default when you install Express. The latest release on npm is 5.3.0. Express 5 needs Node.js 18 or later, according to the Express support page, which lists both 5.x and 4.x as supported with no end date announced for 4.x yet.

The changes that matter most when you move an app from 4 to 5, from the official migration guide:

AreaExpress 4Express 5
Async handlersWrap in try/catch or call next(err)Rejected promises go to error middleware
Wildcard routes/*Named, e.g. /*splat
Optional params/:file.:ext?/:file{.:ext}
Regex in path stringsAllowedNot supported
req.body when unparsed{}undefined
req.queryWritable, extended parserGetter, simple parser
Removed methodsapp.del, res.sendfile, req.paramapp.delete, res.sendFile, explicit sources
Dotfiles in express.staticServed by defaultIgnored by default

The async change is the one most developers notice first: you can write async route handlers and a thrown error or rejected promise reaches your error middleware without extra wrappers. The route syntax change is the one that breaks most upgrades, because old wildcard and optional parameter patterns stop matching. The Express team publishes codemods (npx codemod@latest @expressjs/v5-migration-recipe) that rewrite many of the renamed methods, but they do not cover every change, so plan to run your test suite and check every route after upgrading. One easily missed detail: with dotfiles ignored by default, a .well-known folder served through express.static returns 404 until you allow it.

Which Node.js version to run in 2026

Production apps should run an LTS (long term support) release. The Node.js release page and the Node.js Release schedule give these dates:

VersionStatus in October 2026Key date
Node.js 26CurrentBecomes LTS on 28 October 2026
Node.js 24 (Krypton)Active LTSMaintenance from 20 October 2026, end of life 30 April 2028
Node.js 22 (Jod)Maintenance LTSEnd of life 30 April 2027
Node.js 20 (Iron)End of lifeEnded 30 April 2026

For a new project, Node.js 24 is the safe choice today, and Node.js 26 becomes a strong option once it reaches LTS at the end of October. If you still run Node.js 20, you are on an unsupported runtime and should plan the upgrade now; Node.js 22 buys you only until April 2027. Express 5 runs on all of these.

The schedule itself is changing. Until Node.js 26, only even-numbered releases became LTS. Starting with Node.js 27, Node.js moves to one major release a year, and every major version becomes LTS after its Current phase.

When to use plain Node.js, Express, or something else

Plain Node.js is enough for

  • Command line tools, build scripts and scheduled jobs
  • Queue workers and background processors with no HTTP surface
  • A single webhook or health check endpoint
  • Learning how HTTP actually works under a framework

Express is a good fit for

  • REST and JSON APIs for web and mobile apps
  • Back ends for React, Next.js or Flutter front ends
  • Small to medium services where a light, well known framework keeps onboarding easy
  • Projects that depend on existing Express middleware

Consider an alternative when

  • The codebase will be large and long lived. NestJS adds modules, dependency injection and a fixed structure on top of an HTTP layer. Per the NestJS docs, it uses Express by default and can switch to Fastify.
  • Raw throughput matters most. Fastify is built around low overhead and schema based validation.
  • The team already lives in another language. Spring for Java, Django for Python and Laravel for PHP are mature, productive options. The best back end is often the one your team can maintain.

Common mistakes in Node.js and Express projects

  • Blocking the event loop with synchronous file reads, large JSON parsing or CPU heavy loops inside a request handler.
  • Missing error middleware, so a failed database call crashes the process or leaks a stack trace to the user.
  • No input validation on request bodies and query strings before they reach the database.
  • Pinning an end of life Node.js version in Docker images and CI long after it stopped getting security fixes.
  • Upgrading to Express 5 without testing routes, then discovering that wildcard and optional paths no longer match.

How Codeeo works with Node.js and Express

Codeeo builds back ends on Node.js as part of its custom software development work, choosing between plain Express, NestJS and other stacks based on the size of the system and the team that will maintain it. For a structured, larger build, see the Seamfox recruitment platform, built with NestJS on Node.js.

If you already have a product and need extra hands, you can hire dedicated Node.js developers who work inside your team on upgrades such as moving to Express 5 or a supported Node.js LTS. Codeeo is trusted by 200+ companies and holds a 4.7 rating on Google from 23 reviews. To talk through your project, contact the team.

Frequently asked questions

No.

Node.js is the runtime that executes JavaScript on the server. Express.js is a framework written for Node.js that adds routing, middleware and response helpers. Express cannot run without Node.js, so the Node.js vs Express.js question is really about whether you want a framework on top of the runtime.

Tell us what the business needs. We will tell you what to build first.

Schedule a free consultation and get a written recommendation, with costs, before you commit to anything.

Get in touch

PROVEN RESULTS

4.7 / 5verified reviews on Google