Next.js vs Node.js: Why They Aren’t Competitors
Learn how Next.js and Node.js fit together, what executes Route Handlers by default, and when to use Node.js alone or opt into the edge runtime.

If you’re deciding between Next.js and Node.js, first ask what you’re building. Node.js is a runtime that executes JavaScript outside the browser; Next.js is a framework for building React applications. Choosing Next.js does not mean giving up Node.js. When a Next.js route does server-side work, Node.js is its default runtime.
That makes “Next.js vs Node.js” a comparison between different layers, not two competing ways to do the same job. As this explanation of the distinction puts it, one is the framework you write an app in; the other executes its JavaScript.
Where JavaScript, React, Node.js, and Next.js fit
A useful map is JavaScript → Node.js → React → Next.js, provided you read it as a map of roles rather than a strict dependency chain:
- JavaScript is the language.
- Node.js runs JavaScript outside the browser, including on a server.
- React is a library for building user interfaces. React code can run in the browser; React is not a layer that always runs inside Node.js.
- Next.js is a framework built on React. Its server-side work uses the Node.js runtime by default.
Node.js is neither a UI library nor a framework. Built on Chrome’s V8 engine, it provides the environment and services needed to execute server-side JavaScript, including I/O and network communication. Its event-driven, non-blocking I/O model helps it handle many concurrent connections without assigning a traditional server thread to each one. That makes it a reasonable choice for APIs and real-time services. Its usual single-threaded execution model is worth remembering too: callbacks and promises organize asynchronous work, while worker threads are an option when work needs another execution thread. See the runtime overview and architecture description.
Next.js answers a different question: how should you build and deliver a React application? It adds routing, data fetching and rendering choices, API routes, middleware, image optimization, and automatic code splitting. It supports server-side rendering (SSR), static site generation (SSG), and client-side rendering (CSR). The appropriate rendering choice depends on the content and can vary across an application. Those features make Next.js more than React alone, but they do not make it a replacement JavaScript runtime. (Framework features; rendering choices.)
A Route Handler makes the runtime visible
With SSR, the server generates page HTML before sending it to the client. A Route Handler likewise executes code on the server to produce a response. That code needs a JavaScript runtime; for pages and Route Handlers, Next.js defaults to Node.js. (SSR explanation; runtime defaults.)
For example, this App Router Route Handler illustrates a server-side JSON response. It does not set a runtime, so it uses the Node.js default:
// app/api/hello/route.ts
export function GET() {
return Response.json({ message: 'Hello' })
}
If that route instead needs the edge runtime, the runtime selection is explicit. This is an alternative version of the same file, not a second handler to add alongside it:
// app/api/hello/route.ts
export const runtime = 'edge'
export function GET() {
return Response.json({ message: 'Hello' })
}
The JSON response does not itself tell you which runtime is executing the handler; the route’s runtime configuration does. The runtime comparison describes the practical tradeoff: Node.js offers APIs such as fs, net, and child_process and supports TCP database drivers and Node-specific packages. The edge runtime lacks those Node.js APIs and TCP drivers, but offers much faster cold starts and typically has tighter bundle limits. Keep a database-heavy route that needs a TCP driver on Node.js; an auth check or redirect that does not need those APIs may suit edge.
This is why “server-side” does not automatically mean “Node.js” in every Next.js deployment. Node.js is the default for these routes, not the only runtime you can select.
When Node.js alone is enough—and when Next.js helps
Choose Node.js without Next.js when the project is an API, microservice, or real-time service with no React UI to build. You need a server runtime, but a React application framework would not solve the central problem. Node.js supports those backend uses directly; Next.js is not automatically “better” simply because it includes more features. (Backend use cases.)
Choose Next.js when you want a React UI with routing, rendering choices, and server functions in the same codebase. A Next.js project can contain both UI and Route Handlers, so “Next.js frontend and Node.js backend” need not mean two separate projects. In a larger system, you can also use a Next.js application for UI and rendering alongside separate Node.js services for business logic, authentication, APIs, or database work. (How the roles can be split.)
There is one deployment detail that makes the distinction easy to miss: a static Next.js site can be served without a running Node.js server. That does not imply that Next.js has replaced Node.js for dynamic work. SSR and server endpoints need a server-side runtime; Node.js is the default for Next.js pages and Route Handlers, while an explicitly configured edge route uses the edge runtime instead. (Static versus dynamic deployment; runtime selection.)
The short decision rule is: no React UI and mainly services or APIs? Start with Node.js. Building a React application that benefits from Next.js routing and rendering options? Use Next.js, and decide whether its colocated server functions are enough or whether separate services make sense. Next.js changes the framework you write in; for its server-side routes, it does not remove the need to know what runtime executes them.




