Skip to main content

WASM Binary Inspector

Parse WebAssembly binaries in your browser. Validates magic bytes, decodes section structure, and lists imports and exports — no server needed.

✓ Magic bytes validation ✓ Section breakdown table ✓ Imports & exports list ✓ Hex or Base64 input

Frequently Asked Questions

What are the WASM magic bytes?▼

Every valid WebAssembly binary starts with the 4-byte magic sequence 0x00 0x61 0x73 0x6D, which spells '\0asm' in ASCII. Following the magic bytes are 4 version bytes (0x01 0x00 0x00 0x00 = version 1, the MVP). If these 8 bytes are incorrect, the runtime will reject the file immediately before parsing any sections.

What sections does a WASM binary contain?▼

A WASM binary is divided into sections identified by a 1-byte section ID: Type (1) defines function signatures, Import (2) lists imported functions/memories/tables/globals, Function (3) maps functions to type signatures, Table (4) defines function reference tables, Memory (5) defines linear memory, Global (6) declares global variables, Export (7) lists exported symbols, Start (8) specifies an entry point, Element (9) and Data (11) initialize tables and memory, Code (10) contains function bodies, and Custom (0) holds arbitrary metadata like debug info or DWARF.

What is LEB128 encoding in WASM?▼

LEB128 (Little Endian Base 128) is a variable-length integer encoding used throughout WASM binaries. Each byte uses 7 bits for data and 1 bit (the MSB) as a continuation flag. If the MSB is 1, another byte follows. This allows small integers to occupy just 1 byte while supporting arbitrarily large values. WASM uses unsigned LEB128 for sizes and indices, and signed LEB128 for integer constants.

How do I generate a WASM binary?▼

You can produce WASM from multiple sources: (1) Compile Rust with 'cargo build --target wasm32-unknown-unknown', (2) Compile C/C++ with Emscripten ('emcc main.c -o out.wasm'), (3) Compile WAT text format with 'wat2wasm module.wat -o module.wasm' from the wabt toolkit, (4) Use AssemblyScript which compiles TypeScript to WASM. The wabt toolkit also includes wasm-objdump and wasm-validate for inspection.

What is the difference between WASM imports and exports?▼

Imports are symbols a WASM module needs from the host environment — your JavaScript must provide these when instantiating the module via the imports object: WebAssembly.instantiate(bytes, { 'env': { 'memory': mem, 'log': console.log } }). Exports are symbols the WASM module exposes to the host — after instantiation, these appear as instance.exports.functionName(). A module can import/export functions, tables, memories, and globals.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →