How to convert WASM to WAT
- Add your .WASM file - drop it in the box above or click to browse.
- Convert it to .WAT in a few seconds.
- Download your new .WAT file.
What to expect
- The conversion is faithful but not the original source: you see low-level WASM instructions, not the C/C++/Rust it was compiled from.
- Unnamed functions appear as numeric indices unless you pass a name-generating flag, making large modules hard to follow.
- Editing the WAT and re-assembling with wat2wasm is possible but easy to get wrong for anything non-trivial.
Frequently asked questions
Is wasm-to-wat lossless?
Yes for the module's structure and instructions; it faithfully represents the binary, just not the original high-level source.
wasm-tools or wabt - which should I use?
Both work; wasm-tools is the Bytecode Alliance CLI, wasm2wat ships with WABT. Use whichever is already installed.
Can I convert the WAT back to .wasm?
Yes,
wat2wasm module.wat -o module.wasm (WABT) reassembles it into the binary.How do I get readable function names?
Pass
--generate-names to wasm2wat, or keep the name section in the original build.