WASM Module Inspector

Drop a .wasm file and read its sections with sizes, imports and exports by kind, memory pages and the module name, parsed per the WebAssembly spec.

The interactive tool loads here when JavaScript runs.

About this tool

What is the WASM Module Inspector?

Drop a .wasm file and read what the module declares: every section with its byte size, imports and exports by kind, function, table, global and memory counts, and the module name when a name section carries one. The file is parsed in your tab, nothing is instantiated, and no bytes leave the browser.

The questions this answers are the ones wasm-objdump answers on a machine that has WABT installed: what does this module expect from its host (the imports, module by module), what does it offer (the exports), how much memory does it declare, and where did the bytes go. A 2 MB module whose code section is 300 KB is mostly data or custom sections, and the sorted section table says so before any profiler runs.

Parsing follows the WebAssembly Core Specification's binary format: the \0asm magic, the version field, then a sequence of sections, each one id byte, a LEB128 size and contents. Component-model binaries share the magic but carry a layer field where a core module has version bytes; those are named as components and refused rather than half-read as modules, because their inner structure is a different grammar.

  • Every section listed with its byte size, sorted largest first, custom sections by name
  • Imports and exports by kind (function, table, memory, global), imports grouped by module
  • Memory declarations in pages with the byte sizes (64 KiB per page, per the spec)
  • Function, table and global counts, start-section flag, binary version
  • Module name read from the name custom section's subsection 0 when present
  • Component-model binaries recognised by their layer field and named, not misparsed
  • Copyable text summary; parsing is local and the file never leaves the browser
Read the guide: How to Read Binary Files Without Running Them

Updated

How to use the WASM Module Inspector

  1. Drop a .wasm file on the page, or click to choose one. Files from wasm-pack, Emscripten, Go, AssemblyScript or a vendor SDK all read the same way.
  2. Or press Load a sample to see a 77-byte module with one import, one export and a bounded memory, the same module V8 validates in this site's test suite.
  3. Read the glance row: binary version, file size, function count with how many are imported, exports, tables and globals.
  4. Check the imports table first when a module will not instantiate: every module.name pair listed is something your host must provide, and the kind column says whether it wants a function, a memory, a table or a global.
  5. Use the sorted section table to see where the bytes live: code and data dominate in most modules, and a heavy custom section usually means debug info or embedded source maps that a release build could drop.

Worked examples

The sample module, section by section

Input

The 77-byte test module: an env.log import, an exported add, memory 1 to 4 pages

Output

WebAssembly v1 · 77 B · module "demo" · 2 functions (1 imported) · 1 exports · memory: 1 pages (64.0 KiB) up to 4 pages (256 KiB)

Seven sections: custom "name" (12 B), import (11 B), type (10 B), code (9 B), export (7 B), memory (4 B), function (2 B). Even at 77 bytes the shape of a real module is visible: the function count combines the code section's own functions with imported ones, the way wasm-objdump counts them.

Why a module refuses to instantiate

Input

Any module whose imports list shows wasi_snapshot_preview1 entries

Output

The imports table, grouped by module name, with each required function listed

WebAssembly.instantiate throws a LinkError when an import is missing. The imports table is the complete list of what the host must supply, so comparing it against your import object is the whole diagnosis: the module column names the interface the binary expects, and a module compiled against WASI will not run in a plain browser embedding without a shim.

A component, named instead of misread

Input

A .wasm built by cargo component or jco (the component model)

Output

A component-model binary (layer ≠ 0), not a core module; this reads core modules.

Components reuse the \0asm magic, but bytes 6 and 7 hold a layer field of 0x01 where a core module's version bytes are zero. The inner grammar is different, so pretending to read one as a module would print confident nonsense. The refusal names what the file is.

Memory declared versus memory used

Input

A module declaring memory with no maximum

Output

memory: 16 pages (1.0 MiB), no maximum

The declaration is a floor and a ceiling, not usage. 16 pages minimum means the embedder allocates 1 MiB at instantiation; no maximum means memory.grow may keep asking. For a module you embed in a page you control, a missing maximum is worth fixing at build time, since it is the module author's only lever on worst-case memory.

Background and insight

A core module starts with the 4-byte magic \0asm (00 61 73 6D) and a version field; the spec states the current binary format version is 1. After the preamble come sections with one-byte ids: 0 custom, 1 type, 2 import, 3 function, 4 table, 5 memory, 6 global, 7 export, 8 start, 9 element, 10 code, 11 data, 12 data count. WebAssembly 3.0 adds a tag section with id 13 for exception handling; this inspector reads modules by the 0 to 12 grammar and shows a tag section by its number. Every section is optional, and custom sections may appear anywhere.

Imports and exports are tagged by kind on the wire: 0x00 function, 0x01 table, 0x02 memory, 0x03 global. The import table is the module's contract with its host: each entry names a module and a field, and instantiation fails unless the embedder supplies every one. Memory is declared in pages, and the spec defines the page size as the constant 65536, so a memory of 1 page minimum and 4 maximum means 64 KiB now, 256 KiB ceiling; a missing maximum means the module may grow until the embedder refuses.

Names are not part of the core format. They live in the optional "name" custom section defined in the spec's appendix, where subsection 0 holds the module name and subsection 1 the function names. Release builds usually strip it, which is why most production modules show no module name here: the absence is information, not a parse failure. The counts still hold, because section contents, not names, carry them.

Common use cases

  • A vendor ships you a .wasm and nothing else

    The imports table is the integration spec: every host function the blob expects, by module and name, before you write a line of glue code.

  • Bundle weight investigations

    The sorted section sizes say whether a fat module is code, data or a custom section full of debug names, which decides whether the fix is compiler flags, asset trimming or a strip step.

  • Checking what a build actually exports

    After a wasm-bindgen or Emscripten build, the exports table confirms the functions you meant to expose are there, with memory exported or not as you intended.

  • Triaging a LinkError in production

    Compare the imports listed here against the import object your loader builds; the missing pair is the one the exception named only vaguely.

  • Telling components from modules

    Toolchains now emit both. The inspector names component-model binaries outright, saving the half-hour of wondering why a "wasm file" fails every core-module tool.

Tips and limitations

  • Function count here is imports plus the function section's own entries; wasm-objdump agrees. If the two differ from what your source code suggests, the compiler added thunks or the optimizer merged functions.
  • A custom section's bytes count toward download size but not execution: "name", producers and target_features sections are all safe to strip for release. The name section is also why stack traces in devtools show real function names, so keep it in debug builds.
  • Memory pages are 64 KiB by definition. A tool or doc that reports WebAssembly memory in other units is converting; the binary only ever stores page counts.
  • The start section (id 8) means code runs at instantiation, before you call anything. The "has start" chip is worth noticing when you are sandboxing a module you do not trust: instantiation itself executes its start function.
  • An exception-handling tag section from WebAssembly 3.0 shows as section#13 with its size; the module still reads. Counts for tags are not broken out.
  • This page reads structure only: it does not validate function bodies, type-check or execute. WebAssembly.validate in your own console is the cheap next step when structure looks fine but instantiation still fails.

Sources and further reading

  1. WebAssembly Core Specification: Binary Format, Modules, WebAssembly Community Group. The \0asm magic, version, section ids and encodings this parser follows
  2. WebAssembly Core Specification: Name Section, WebAssembly Community Group. The "name" custom section; subsection 0 is the module name
  3. Component Model Binary Format, WebAssembly on GitHub. The preamble layer field that tells components apart from core modules

Frequently asked questions

How do I see what is inside a .wasm file without installing WABT?

Drop it here. The section table, imports, exports, memory and counts are the structural half of what wasm-objdump prints, read in the browser from the binary format the WebAssembly Core Specification defines. What this page does not do is disassemble function bodies; for instruction-level work you still want wasm-objdump or wasm-tools print.

What are the sections of a WebAssembly binary?

Thirteen numbered kinds in the core spec: custom (0), type (1), import (2), function (3), table (4), memory (5), global (6), export (7), start (8), element (9), code (10), data (11) and data count (12), with a tag section (13) added in WebAssembly 3.0. Each is one id byte, a LEB128 length, then contents, and all of them are optional.

Why does my wasm file fail here with a component-model error?

Because it is a component, not a core module. Both start with \0asm, but a component carries a layer field of 1 in bytes 6 and 7 where a core module has zeros. Components wrap core modules in a richer grammar of interfaces and instances, so a core-module parser reading one would produce garbage; naming it is the honest output.

How much memory does a WebAssembly module use?

The binary declares bounds, not usage: a minimum the embedder must allocate at instantiation and an optional maximum for memory.grow. Each page is 65536 bytes by definition. This inspector shows both bounds in pages and bytes; actual usage over time is a profiler question, not a header question.

Why does my module show no module name?

Names live in an optional custom section ("name"), and release toolchains strip it to save bytes. Subsection 0 of that section is the module name, so when it is absent there is nothing to read. Everything else on the page still holds, because the structural sections carry the counts and sizes themselves.

Can a wasm file run code just by being inspected?

Not here. This page decodes bytes; it never calls WebAssembly.instantiate or compile, so nothing executes, including a start section. That flag is shown precisely because instantiating elsewhere would run it: a module with a start function executes code the moment any embedder instantiates it.

What does the imports table tell me about running a module?

Everything the host must provide. Each row is a module.name pair with a kind, and instantiation fails with a LinkError unless your import object supplies all of them with matching kinds. Reading this table against your loader code is the fastest way to find the missing or misnamed import.

Is there an in-depth guide to the WASM Module Inspector?

Yes. “How to Read Binary Files Without Running Them” covers the background, how it works, common pitfalls and worked examples. Read the full guide.