.wasm File Extension
.wasm file contains, how to inspect or run WebAssembly safely, how Poly supports it, and when to keep WAT or source code instead. File extension details for .wasm
Storage Only| File type | WebAssembly binary module |
|---|---|
| MIME type | |
| Encoding | Binary WebAssembly module with a fixed header and section-based encoding |
| Operating systems | Windows, macOS, Linux |
| Opens with | Wasmtime, Node.js, WABT, Web browsers through an application |
| Poly support | Yes. Poly stores, syncs, shares, versions, and downloads .wasm files. |
| Indexed by Poly | Partial. Poly indexes the filename and basic file properties, not instructions or module sections. |
| Preview in Poly | No. Download the file to inspect or run it with a WebAssembly-aware tool. |
| Poly agent | No. The Poly agent cannot read the compiled module contents. |
What kind of file is a .wasm?
A .wasm file is a compiled WebAssembly binary module. It can contain functions, types, imports, exports, memory declarations, instructions, data, and optional custom sections. It is portable low-level code rather than the original C, C++, Rust, or other source used to build it. The registered media type is application/wasm.1
An ordinary module begins with the four magic bytes 00 61 73 6D, followed by the version bytes 01 00 00 00. Checking that eight-byte preamble is more reliable than trusting the filename alone, although a WebAssembly parser must still validate all sections.2
.wat. Renaming module.wasm to module.wat does not convert or disassemble it.How do I open a .wasm on my computer?
A .wasm file is not a document to double-click. Choose a tool according to what you need:
- Use WABT tools such as
wasm-validate,wasm-objdump, andwasm2watto validate or inspect the binary.3 - Use Wasmtime to run a compatible command-line module on Windows, macOS, or Linux. A module that expects browser or other custom imports needs its intended host instead.4
- Use Node.js or a web application to instantiate modules designed for their JavaScript environment.
- Use browser developer tools to debug a module loaded by a website. Browsers do not render a standalone
.wasmas a normal page.
Avoid running an unfamiliar module merely to identify it. Validation checks WebAssembly structure and types, not whether the program's behavior is trustworthy.
Poly support for .wasm
Poly stores, syncs, shares, versions, and downloads .wasm files. It recognizes the filename convention and keeps the name and ordinary file properties searchable.
Poly does not execute or disassemble uploaded modules. It does not extract imports, exports, instructions, custom sections, or embedded debug data, and it provides no in-app content preview. The Poly agent cannot inspect the compiled contents. Keep source code or a trusted text-format export beside the binary when you want content search and agent-readable context.
History of .wasm
Browser-engine teams developed WebAssembly as a compact, portable compilation target. Chrome, Edge, Firefox, and WebKit representatives announced consensus on the initial browser format in February 2017.5 W3C published WebAssembly Core Specification 1.0 as a Recommendation on December 5, 2019.6
The suffix abbreviates WebAssembly. IANA registered application/wasm in 2021 with .wasm as its filename extension and 00 61 73 6D as its magic number.1 The format also runs outside browsers through runtimes such as Wasmtime, but a module may depend on host interfaces that are not stored in the core format.
Working with .wasm and alternatives
Use the representation that fits the job:
| Need | Better choice |
|---|---|
| Compact distribution and execution | .wasm binary module |
| Instruction-level inspection or small tests | .wat text format |
| Maintenance, review, and reproducible builds | Original source plus build files |
Convert a trusted binary with wasm2wat module.wasm -o module.wat; use wat2wasm for the reverse direction.3 Disassembly is not source recovery. Compiler optimization can remove names and restructure code, while comments and high-level types are usually absent unless separate debug information preserves them.
For web deployment, serve the file as application/wasm. Streaming compilation and instantiation rely on that response type.7 Keep cryptographic hashes or signed release metadata when artifacts must be pinned, and review the imports and host permissions before execution.
Footnotes
- Internet Assigned Numbers Authority. application/wasm Media Type Registration. ↩ ↩2
- WebAssembly Community Group. WebAssembly Binary Format: Modules. ↩
- WebAssembly project. Advanced Tools: WABT. ↩ ↩2
- Bytecode Alliance. Wasmtime CLI Options. ↩
- W3C WebAssembly Community Group. WebAssembly Consensus and End of Browser Preview. ↩
- World Wide Web Consortium. WebAssembly Core Specification 1.0. ↩
- MDN Web Docs. WebAssembly.instantiateStreaming(). ↩