It's single threaded on the JavaScript side, but there are multiple threads under the hood of v8.

Answer from ralphtheninja on Stack Overflow
🌐
Quora
quora.com › Why-is-Node-js-single-threaded-Is-it-a-constraint-of-the-V8-engine-or-of-the-JavaScript-language-itself
Why is Node.js single threaded? Is it a constraint of the V8 engine or of the JavaScript language itself? - Quora
Answer (1 of 5): It is both a V8 constraint and sort of a JavaScript constraint, but mostly a consequence of Node’s design. The last reason is the most interesting I think. Yes, V8 is a single threaded execution engine. It’s built to run exactly one thread per JavaScript execution context.
🌐
Stack Overflow
stackoverflow.com › questions › 49137228 › v8-engine-is-single-threaded
node.js - V8 engine is single threaded? - Stack Overflow

It's single threaded on the JavaScript side, but there are multiple threads under the hood of v8.

Answer from ralphtheninja on stackoverflow.com
🌐
Medium
medium.com › @elliott.hill_43300 › javascript-is-not-single-threaded-b23ed698b9e1
Javascript is not single-threaded | by Elliott Hill | Medium
November 28, 2024 - I think the word was selected because an engine makes a car go fast and V8 is fast. V8 provides the runtime environment to Javascript. This is not in question, its written on the V8 website. # Fact 3: Programming languages ARE their implementations · Or to put it better: programming languages ...
🌐
Reddit
reddit.com › r/node › why everyone is saying that js is single threaded? is that true?
r/node on Reddit: Why everyone is saying that JS is single threaded? Is that true?

JS itself is single-threaded. This is a benefit, since constantly creating new threads can be relatively expensive. Browsers and Node have added APIs to enable spawning new threads. These are meant for long-running, synchronous tasks that would otherwise block the main thread.

🌐
GeeksforGeeks
geeksforgeeks.org › javascript › why-javascript-is-a-single-thread-language-that-can-be-non-blocking
Why JavaScript is a single-thread language that can be non-blocking ?
September 10, 2020 - This is achieved through the use of the event loop, callback queues, and asynchronous APIs provided by the environment (like the browser or Node.js). The event loop is the mechanism that allows JavaScript to handle asynchronous operations while running in a single thread.
🌐
Medium
medium.com › @conboys111 › how-does-the-v8-engine-optimize-javascript-for-lightning-fast-performance-0ebc9252ac1c
How Does the V8 Engine Optimize JavaScript for Lightning-Fast Performance? | by myHotTake | Medium
January 3, 2025 - The object’s shape changes, and V8 has to slow down and reprocess how it accesses properties, just like if I added unexpected parts to the car.
🌐
web.dev
web.dev › articles › performance tips for javascript in v8
Performance tips for JavaScript in V8 | Articles | web.dev
October 11, 2012 - In parallel with the full compiler, V8 re-compiles "hot" functions (that is, functions that are run many times) with an optimizing compiler. This compiler uses type feedback to make the compiled code faster - in fact, it uses the types taken from ICs we just talked about!
🌐
Medium
noncodersuccess.medium.com › the-v8-javascript-engine-jit-compilation-and-more-what-makes-v8-a-javascript-powerhouse-da54f310373a
The V8 JavaScript Engine | JIT, Compilation, and More: What Makes V8 a JavaScript Powerhouse | by NonCoderSuccess | Medium
November 15, 2024 - To achieve high performance, V8 uses several advanced techniques: ... Instead of interpreting JavaScript line-by-line, V8 compiles JavaScript into machine code while the program is running. This allows for faster execution since machine code runs directly on the hardware.
🌐
Stack Overflow
stackoverflow.com › questions › 30638549 › why-node-js-is-fast-when-its-single-threaded
javascript - Why node.js is fast when it's single threaded? - Stack Overflow

First, why is a program faster when multi-threaded ?

It's partly due to the fact a multi-threaded program can run on multiple cores but the main reason, by far, is that when a thread is waiting for some IO operation (which is very often, especially in a server), the other threads can still progress.

Now, what about node ?

Node isn't single threaded. The user script in JS is executed in one thread but all IO operations are natively handled by libuv and the OS which are multi-threaded.

More explanation here.

In practice, this means that several requests are handled in parallel. Here's a very (very) simplified example of a possible sequence of actions:

user script                     | node + OS "threads" (libuv)
-------------------------------------------------------------
receive and analyze request 1   |
ask node for file 1             | fetching file 1
receive and analyze request 2   | fetching file 1
ask node for file 2             | fetching file 1, fetching file 2
prepare response header 1       | fetching file 2
tell node to send file 1        | send file 1, fetching file 2
prepare response header 2       | send file 1
tell node to send file 2        | send file 1, send file 2

The whole architecture of node (and io.js) makes it simple to have a high level of parallelism. The user thread is only called by the event loop for very short tasks which stop at the next IO operation (well, not really only IO, but most often) when your code gives to node a callback that will be called when the operation finished.

Of course this only works when you're using the asynchronous functions of Node. Any time you use a function ending in "Sync" like writeFileSync, you're defeating the concurrency.

Answer from Denys Séguret on stackoverflow.com
Find elsewhere
🌐
DEV Community
dev.to › bbarbour › if-javascript-is-single-threaded-how-is-it-asynchronous-56gd
If Javascript Is Single Threaded, How Is It Asynchronous? - DEV Community
June 3, 2019 - So how do we get asynchronous code ... that, which has Web API that handle these tasks in the background. The call stack recognizes functions of the Web API and hands them off to be handled by the browser....
🌐
Medium
skchawala.medium.com › javascript-is-a-single-threaded-beast-then-how-the-heck-asynchronous-code-execution-works-bf3279bd7bff
Javascript is a single threaded beast, then how the heck asynchronous code execution works
November 15, 2024 - You might have heard or read somewhere that javascript is single threaded programming language unlike other multithreaded programming…
🌐
GeeksforGeeks
geeksforgeeks.org › node.js › explain-v8-engine-in-node-js
Explain V8 engine in Node.js - GeeksforGeeks
March 20, 2025 - Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.
🌐
Groove Technology
groovetechnology.com › home › blog › technologies › why javascript is single threaded?
Understanding Why JavaScript Is Single Threaded
September 26, 2024 - Discover why JavaScript is designed to be single-threaded and how this impacts its performance in asynchronous web development.
🌐
AppSignal
blog.appsignal.com › 2020 › 07 › 01 › a-deep-dive-into-v8.html
A Deep Dive Into V8 | AppSignal Blog
July 1, 2020 - Learn the basics of V8's internal functioning, compilation and garbage collection processes, single-threaded nature, and more.
🌐
Hacker News
news.ycombinator.com › item
V8 is a single-threaded VM and I don't see that changing any time soon, it's ver... | Hacker News
These guys have their work cut out for them if they want to support the V8 API from within SM. It's a well designed API but large and fast moving · Still, an interesting project. I'm going to watch it, maybe submit a few patches
🌐
V8
v8.dev
V8 JavaScript engine
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
🌐
Scaler
scaler.com › topics › javascript-multithreading
How to Perform Multithreading in JavaScript? - Scaler Topics
December 13, 2022 - With this article by Scaler Topics learn in detail about the concepts of Multithreading in JavaScript with examples and explanations, read to know more.
🌐
Quora
quora.com › Why-does-V8-only-compile-JavaScript-on-runtime-instead-of-giving-developers-the-option-to-supply-compiled-code
Why does V8 only compile JavaScript on runtime, instead of giving developers the option to supply compiled code? - Quora
Answer (1 of 7): There are a few reasons. 1. Code has to be compiled for the platform it runs on. You would need to supply versions for every possible computer variant. Instead the browser takes care of this. This is a MAJOR advantage of javascript and why the world has been slowly moving to web...
🌐
Quora
quora.com › Google-claims-that-JavaScript-V8-is-20-slower-than-C-its-true
Google claims that JavaScript (V8) is 20% slower than C++, its true? - Quora
Answer (1 of 15): If somebody benchmarks most frequently used algorithms and puts results here, then I would believe. For example, C++’s std::map is useful. [code]std::map stringToIntMap; stringToIntMap["some string"]=5; [/code]Can Javascript do same with nearly equivalent perf...