Glossary · Web Development

WebAssembly (Wasm)

WebAssembly is a compact binary instruction format that lets code from languages like Rust, C++ and Go run in the browser at near-native speed.

Updated October 6, 2026

WebAssembly (Wasm) is a low-level binary format that browsers execute in a sandboxed virtual machine alongside JavaScript. Code written in languages such as Rust, C, C++ or Go is compiled to a .wasm module, which the page loads and calls.

Why it matters

Wasm brings performance-sensitive work to the web: image and video processing, games, CAD tools, cryptography, and ports of desktop software. It is not a replacement for JavaScript. Wasm modules cannot touch the DOM directly; they exchange numbers and memory with JavaScript, which handles the user interface. Outside browsers it is also used on servers and edge platforms as a portable, sandboxed runtime.

Example

const { instance } = await WebAssembly.instantiateStreaming(
  fetch("/add.wasm")
);
console.log(instance.exports.add(2, 3)); // 5

instantiateStreaming compiles the module while it downloads. The server should send the file with the application/wasm MIME type, or streaming compilation fails.

Common mistakes

  • Expecting Wasm to speed up ordinary page logic; crossing the JavaScript boundary has a cost.
  • Shipping large modules without compression or caching.
  • Serving the wrong MIME type.
  • Assuming it is a new language rather than a compilation target.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.