V8: The Engine Powering Chrome and Node.js
V8 is the engine that runs your JavaScript, translating it into machine code. It powers both the Chrome browser and the Node.js server-side runtime. The common footgun is confusing the engine (V8) with the runtime environment that provides it with APIs.
WHY IT EXISTS JavaScript was originally interpreted and slow. To run complex applications in the browser and later on servers, a much faster way to execute JS was needed. V8 was created by Google to be a high-performance JavaScript and WebAssembly engine, making modern web and server-side applications possible.
THE MENTAL MODEL Think of V8 as the engine in a car. The car itself is the browser (Chrome) or a server runtime (Node.js). The car provides the chassis, wheels, and steering wheel—APIs for interacting with the DOM, file system, or network. The engine's only job is to take the fuel (your JavaScript code) and make the car go, fast.
HOW IT WORKS At a high level, V8 takes the JavaScript code you write and compiles it directly into native machine code that your computer's processor can execute very quickly. This is often done using a technique called Just-In-Time (JIT) compilation. It doesn't just run in browsers; it's a standalone C++ program that can be embedded into any application to add JavaScript execution capabilities.
WHEN TO USE IT You don't typically choose to "use" V8 directly. You use it implicitly whenever you write JavaScript for a platform that embeds it. This includes developing web pages for Google Chrome (and other Chromium-based browsers like Microsoft Edge) or building backend services with the Node.js runtime. It's the default, invisible power source.
WHEN NOT TO USE IT You are not using V8 when your code runs in environments with different engines. For example, Firefox uses its own engine called SpiderMonkey, and Safari uses JavaScriptCore. Some newer server-side runtimes like Bun also use JavaScriptCore by default. Your code is the same, but the engine executing it is different.
ONE CANONICAL EXAMPLE The most prominent example of V8's use outside the browser is Node.js. The Node.js runtime bundles the V8 engine with other libraries to provide an environment where JavaScript can be used for server-side programming, accessing the file system, handling network requests, and performing other tasks not possible in a browser context.
Read the original → en.wikipedia.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.