What is WebAssembly?
Also known as: Wasm
WebAssembly (Wasm) is a portable binary instruction format designed for sandboxed, near-native execution in web browsers, edge runtimes, and server-side environments.
WebAssembly (Wasm) is a low-level, portable binary instruction format that provides a compact representation of code for sandboxed execution. It was designed by the W3C WebAssembly Community Group, first released as a Minimum Viable Product in March 2017, and became an official W3C Recommendation on December 5, 2019. Wasm is not a replacement for JavaScript but a compile target for languages such as C, C++, Rust, Go, and many others, enabling near-native performance in environments that traditionally relied solely on JavaScript.
Wasm modules execute inside a stack-based virtual machine with linear memory, enforced control flow integrity, and no direct access to host system resources unless explicitly granted through an embedded API. The format uses a structured binary encoding that is both compact for network transfer and fast to decode and compile. Browsers compile Wasm to native machine code using existing JIT and tiered-compilation pipelines. The specification defines a core module structure, a set of value types (i32, i64, f32, f64), and instruction groups for control flow, memory operations, and parametric operations.
In the wider web stack, Wasm sits alongside JavaScript as a coequal execution target. It is loaded via the WebAssembly JavaScript API, instantiated, and its exported functions called from JavaScript. Beyond the browser, WebAssembly System Interface (WASI) provides a POSIX-like abstraction for running Wasm modules on servers, edge nodes, and embedded systems. Wasm is also used in plugin systems (e.g. Envoy proxy filters, content security policies in cloud platforms) and as an intermediate representation in toolchains. The spec is versioned as WebAssembly Core Specification 2.0 (W3C Recommendation, April 2022), with proposals for garbage collection, threads, and SIMD reaching various stages of standardization.
Key facts
- W3C Recommendation standard since December 2019 (WebAssembly 1.0).
- Provides near-native execution speed with deterministic sandbox isolation.
- Compile target for C, C++, Rust, Go, and at least 40 other languages.
- Binary format is typically 10-20% smaller than equivalent minified JavaScript.
- WASI extends Wasm execution to non-browser environments like servers and edge runtimes.
- Specification versions: 1.0 (2019), 2.0 (2022, with GC and tail-call proposals).
How it works in practice
Related terms
References
More in Web Protocols
CORS
CORS (Cross-Origin Resource Sharing) is a browser security mechanism that lets servers explicitly allow web pages from one origin to request resources from a different origin via HTTP response headers.
GraphQL
GraphQL is a query language and runtime for APIs that lets clients request exactly the data they need in a single round trip, reducing over-fetching and under-fetching.
gRPC
gRPC is a high-performance, open-source remote procedure call framework initially developed by Google. It uses HTTP/2 for transport, Protocol Buffers as its interface definition language and message serialization format, and supports bidirectional streaming.
HTTP
HTTP is a text-based request-response protocol that defines how web clients and servers exchange resources, forming the foundation of data communication on the World Wide Web.
HTTP Pipelining
HTTP Pipelining is a technique in HTTP/1.1 that sends multiple requests on a single connection without waiting for each response, now largely replaced by HTTP/2 multiplexing.
HTTP Status Code
A three-digit integer in an HTTP response that indicates the result of the server's attempt to process the request, grouped into five classes (1xx through 5xx).
HTTP/1.1
HTTP/1.1 is the persistent-connection version of the Hypertext Transfer Protocol, defined in RFC 2616 and updated by RFCs 7230-7235, enabling multiple requests and responses over a single TCP connection.
HTTP/2
HTTP/2 is a binary, multiplexed version of HTTP that reduces latency through header compression, stream prioritization, and server push, as defined in RFC 7540.
HTTP/3
HTTP/3 is the third major version of the Hypertext Transfer Protocol, which runs over QUIC instead of TCP to reduce latency, eliminate head-of-line blocking, and improve connection setup time.
HTTPS
HTTPS (HTTP Secure) is HTTP traffic encrypted inside a TLS session, protecting data confidentiality, integrity, and server authenticity between a client and a web server.