What is the WASM file format?
A .wasm file is a compiled WebAssembly module: portable binary bytecode for a stack-based virtual machine. Developers write code in C, C++, Rust, Go, or another supported language and compile it to .wasm so it runs at close to native speed. On the web the module runs alongside JavaScript; the browser fetches it and executes it in a sandbox with no direct access to your system.
WebAssembly is an open standard from the W3C WebAssembly Working Group, first stable in March 2017 and a W3C Recommendation since December 2019. Every module starts with the 8-byte header 00 61 73 6D 01 00 00 00 (the string \0asm plus a version field), followed by numbered sections for types, imports, functions, memory, exports, and the code. The readable text counterpart is the .wat format.
Security & safety
RISK: MEDIUMWebAssembly runs inside a sandbox with no direct access to the file system, network, or DOM unless the host grants it, so a module cannot escape on its own. The risk comes from what the surrounding page or runtime allows: malicious sites have used Wasm for in-browser cryptomining and for obfuscating logic that is harder to read than JavaScript. Only run standalone .wasm files from sources you trust, since a WASI runtime can be given file and network permissions.
Format details
in a nutshell- Wavefront / general 3D scene data - A few older or niche 3D and simulation tools have used .wasm for scene or mesh data, unrelated to WebAssembly.
- Application-specific save or cache files - Some standalone programs have reused the .wasm extension for internal data files; these are not WebAssembly modules and lack the \0asm header.
Programs that open WASM files
.wasm served by a page and shows the disassembled module in the Debugger panel. .wasm modules automatically when a web page instantiates them; DevTools can disassemble and debug them. wasm2wat file.wasm -o file.wat to disassemble the binary into readable text; wasm-objdump prints section details. wasm2wat file.wasm; installable via Homebrew. wasm2wat file.wasm or dump sections with wasm-objdump -x file.wasm. Technical details
deep spec| Encoding | Binary bytecode (stack-machine instructions) |
| Byte order | Little-endian for multi-byte scalars; LEB128 for integers |
| Container | Module = 8-byte header followed by a sequence of numbered sections |
| Compression | None built in; commonly served with gzip or Brotli over HTTP |
| Typical size | Tens of KB to several MB depending on the compiled program |
| Structure | Header (magic + version) then sections: Type, Import, Function, Table, Memory, Global, Export, Start, Element, Code, Data, plus optional Custom sections (names, DWARF debug info). |
| Integrity | No internal checksum; integrity handled by transport (HTTPS) or Subresource Integrity on the web |
| Platforms | Windows, macOS, Linux, Android, iOS, Web |
| Initial Release Full | March 2017 (MVP / binary format version 1) |
| Notes | Text-format counterpart is the .wat file. Source languages such as C, C++, Rust and Go compile to .wasm. Runs sandboxed in browsers and in standalone runtimes (Wasmtime, Wasmer, WasmEdge, WAMR). WASI extends it to server and CLI use. |
| Instruction Set | Virtual stack machine, structured control flow, 32/64-bit integers and floats, linear memory |
| Debug Info | Optional DWARF data and a name section carried in Custom sections |
| Released | 2017 |
| Latest version | WebAssembly 3.0 (2025); binary version field 0x01 |
| Open standard | Yes · royalty-free |
| Specification | webassembly.github.io |
WASM conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about WASM files.
Frequently asked questions
How do I open a WASM file?
wasm2wat file.wasm from WABT, or run it outside a browser with Wasmtime or Wasmer.Can I edit a WASM file?
.wat text format with wasm2wat, edit that, then reassemble with wat2wasm. For real changes you normally edit the original C, C++, or Rust source and recompile.What is the difference between .wasm and .wat?
.wasm is the compact binary a machine executes; .wat is the equivalent human-readable text (WebAssembly Text Format). They convert back and forth losslessly with WABT.Why is my browser downloading a .wasm file instead of running it?
.wasm with the application/wasm MIME type. If it is served as a generic or text type the browser may download it or refuse to stream-compile it. Fix the server's content type.Is a WASM file safe to run?
What programs create WASM files?
wasm32 target with wasm-pack, TinyGo/Go, and Clang/LLVM produce .wasm output.