WebAssembly has a deliberately tiny set of value types. This reference lists each one with its
single-byte binary encoding, bit width, JavaScript mapping and — for v128 — the SIMD lane layouts.
How it works
Value types appear in the binary format’s type section and in function signatures. Each is encoded as one byte:
0x7F i32 0x7E i64
0x7D f32 0x7C f64
0x7B v128 0x70 funcref
0x6F externref
The four number types are split into integers (i32, i64) and IEEE-754 floats (f32,
f64). Integers carry no signedness — i32.div_s vs i32.div_u decides interpretation per
instruction. The vector type v128 holds 128 bits reinterpreted as lanes by SIMD instructions.
The two reference types are opaque handles: funcref to a Wasm function, externref to a host
value.
JavaScript boundary
When Wasm functions are called from JS, types map as:
i32,f32,f64→Numberi64→BigInt(a 53-bit Number cannot hold 64 bits exactly)funcref→ a JS function (ornull)externref→ any JS value passed through unchangedv128→ cannot cross the JS boundary directly; it is internal to Wasm SIMD code
Keep this in mind when wiring imports and exports — passing a plain Number where an i64 is
expected throws a TypeError.