WebAssembly Module Inspector
Look inside any .wasm file: sections, imports and exports, functions disassembled to WAT, size charts, a hex view and a validation report.
Berjalan dalam pelayar anda. Fail anda tidak pernah meninggalkan peranti. Lihat cara menyemaknya
…
Cara melakukannya
- 1Open a file
Drop a .wasm file on the page or press Open .wasm file; or load the demo module.
- 2Check validity
Read the Validation card and any structure warnings.
- 3Review imports and exports
Open Imports & exports to see what the module needs and provides.
- 4Read a function
In Functions, filter by name and click a row to see its WAT.
- 5Find size problems
Use the Size tab to rank sections, functions and data.
- 6Export
Download the .wat text or a JSON report.
Tentang alat ini
WebAssembly modules are binary files that are hard to read without a toolchain. This inspector decodes them in the browser, following the binary format of the WebAssembly Core Specification. It lists every section with its offset and size, the imports a module expects from JavaScript or WASI, the functions, memories, tables and globals it exports, element and data segments, and the producers and name custom sections that compilers add. Function bodies are disassembled into the WebAssembly text format, with block indentation and names from the name section, so you can see what a function really does. A size view ranks sections, the largest functions, data segments and the most used instructions, which is the first step when a bundle is too big. Validation combines the browser's own engine with structural checks, and simple exported functions can be called with arguments.
Who this is for
Web developers shipping Rust, C, C++, Go, AssemblyScript or Zig code to the browser, people optimising bundle size, security reviewers checking what a module imports, and students learning how WebAssembly works.
Opening a module
Drop a .wasm file on the page or use Open .wasm file. Load demo module builds a small module byte by byte (an imported log function, add, a recursive factorial, a loop that counts and a data string) to explore the views.
Sections and structure
The overview table shows each section's id, name, offset and share of the file; click a row to jump to it in the hex view. The module name and producers (language, processed-by, SDK) are shown when present. Structure checks report sections out of order, function and code counts that disagree, exports that point nowhere, duplicate export names and truncated data.
Imports and exports
Imports show module, name, kind and signature, for example env.log as (i32) → void or a memory with its page limits. Exports show their signature; functions that take only numbers have a Call button that instantiates the module with stub imports which log their arguments.
Functions and WAT
The functions table lists index, name, signature, number of locals and body size, with a filter. Selecting one disassembles it to text format: blocks, loops and ifs are indented, locals and calls use their names, memory instructions show offset and alignment. The Text tab shows the whole module; Download .wat saves it.
Size and data
Bar charts rank sections, the 15 largest functions and data segments. DWARF debug sections are flagged with their size so you know what stripping would save. The data tab lists globals with their initial values, tables, element segments and data segments with a printable preview.
Worked example
The demo module is 358 bytes. Its exports are add, factorial, count_up, memory and counter. Calling factorial with 6 returns 720, count_up with 4 logs env.log(0) to env.log(3), and the data segment at offset 16 reads Hello from WebAssembly!.
Limits
The disassembler covers WebAssembly 2.0 plus bulk memory, reference types, tail calls, exceptions, SIMD and atomics opcodes; SIMD and atomic instructions are shown with generic names for less common opcodes. Garbage-collection proposal types and component-model files are reported but not decoded. Calling functions runs the module in this page, so only call modules you trust.
Contoh berselesaian
Demo module (358 bytes): factorial(6) → 720; count_up(4) logs 0 to 3; data at 16 = "Hello from WebAssembly!".
Ringkasnya
- Kategori: Pembangun & data
- Berjalan dalam pelayar, tanpa pendaftaran, tanpa muat naik.
- Maklumat yang anda masukkan kekal pada peranti anda.
- Tersedia dalam bahasa Inggeris.
- Kandungan disemak kali terakhir:
- Sumber rasmi: W3C WebAssembly Core Specification 2.0
Soalan lazim
Is the .wasm file uploaded?
No. It is read with the File API and decoded in your browser.
Can it show Rust or C function names?
Yes, when the module keeps the name custom section; release builds often strip it, and then functions show as func plus their index.
What does Invalid mean?
The browser's WebAssembly engine refused to compile the file; the message shows its reason, such as a type mismatch or an unknown opcode.
How can I make my module smaller?
Look at the size tab: strip debug sections, check the largest functions and data segments, and run your toolchain's optimiser such as wasm-opt -Oz.
Can I edit the module?
No. The inspector is read-only; download the WAT, edit it and reassemble with a tool such as wat2wasm.
Does it support WASI modules?
Yes for inspection: WASI imports such as wasi_snapshot_preview1.fd_write are listed. Calling WASI functions needs a real WASI runtime.
