File Formats
  • Audio
  • Video
  • Images
  • 3D & CAD
  • Documents
  • Data
  • Code
  • System
Code
  • Source code
  • Bytecode
  • Programs & libraries
  • Object files
  • Debug info
  • Firmware & ROMs
  • Notebooks
  • Shaders
  • Build files
  • Packages & installers
  1. Home
  2. Code
  3. Bytecode
  4. WASM
.WASM
  • Overview

.WASM

WebAssembly module

Introduction

A .wasm file is a compiled WebAssembly module: compact bytecode for a simple, portable virtual machine. Every major web browser runs it beside JavaScript, and standalone runtimes run it outside the browser. Compilers for C, C++, Rust, Go and other languages can produce it.

The same module can be written as text in the .wat format, which tools convert to and from the binary.

Software

  • Every major web browser: Chrome, Firefox, Safari and Edge
  • Node.js (Windows, macOS, Linux)
  • Wasmtime (Windows, macOS, Linux)
  • Wasmer (Windows, macOS, Linux)
  • WABT, with wasm2wat and wasm-objdump (Windows, macOS, Linux)
  • Binaryen, with the wasm-opt optimiser (Windows, macOS, Linux)
  • Ghidra, with a WebAssembly extension (Windows, macOS, Linux)

Structure

A module starts with an 8-byte header: the magic bytes 00 61 73 6D (\0asm) and the version, 1, as a little-endian 32-bit number. Then come sections. Each is one byte of section ID, its size as an unsigned LEB128 number, and its contents. The standard sections appear at most once each and in a fixed order: type, import, function, table, memory, global, export, start, element, data count, code and data. Custom sections (ID 0) can appear anywhere and hold extras such as function names for debuggers.

  1. 0magic 00 61 73 6D4 bytes
  2. 4version 01 00 00 004 bytes
  3. 8sections, one after anothervaries
    1. +0id: 1 type, 2 import, 3 function … 10 code, 11 data1 byte
    2. +1size of the contents, LEB1281 to 5 bytes
    3. …contentssize bytes
A WebAssembly module: an 8-byte header, then sections.
© 2026 fileformats.org About Contact Made by Lewpen