WebAssembly MIME Type
application/wasm files contain, how to inspect and run them, why the HTTP content type matters, and how Poly handles them. MIME type details for application/wasm
In active use| MIME type | application/wasm |
|---|---|
| Extensions | .wasm |
| Magic number | 00 61 73 6D |
| First standardized | 2019 |
| Created by | W3C WebAssembly Working Group |
| Browser support | Chrome, Edge, Firefox, Opera, Safari |
| Example applications | Wasmtime, Node.js |
| Poly support | Yes. Poly recognizes application/wasm and .wasm files, then stores and syncs them without executing or disassembling them. |
| Indexed by Poly | Partial. WebAssembly files are searchable by filename and ordinary file properties, but Poly does not index instructions, imports, exports, custom sections, or embedded debug data. |
| Preview in Poly | No. Poly has no WebAssembly viewer; download the file to inspect or run it with a dedicated tool. |
| Poly agent | No. The Poly agent cannot read or reason about the compiled module's contents. |
What does application/wasm mean?
The application/wasm media type identifies a WebAssembly binary module. A .wasm file contains portable low-level instructions, types, functions, imports, exports, memory declarations, and optional custom sections. It is compiled output rather than source code, even though browsers and developer tools can often map it back to a readable representation.1
Every ordinary WebAssembly module starts with the four bytes 00 61 73 6D. The last three bytes spell asm in ASCII. The next four bytes are the binary-format version, currently 01 00 00 00 for version 1 of the encoding.2
.wasm. The related WebAssembly text format usually uses .wat and is text, so it should not be served as application/wasm.3How the format and MIME type became standards
WebAssembly was developed openly by browser-engine teams and the W3C WebAssembly Community Group. In February 2017, representatives of Chrome, Edge, Firefox, and WebKit agreed that the initial API and binary format were ready for browsers to ship by default.4
The W3C published WebAssembly Core Specification 1.0 as a Recommendation on December 5, 2019. It defines a portable virtual instruction set, validation rules, execution semantics, and binary and text representations.5 IANA registered application/wasm on April 20, 2021, with no required or optional parameters, .wasm as the extension, and 00 61 73 6D as the magic number.1
The format continues to evolve through compatible standard releases. A module can also depend on host conventions that the core format does not define, such as browser-supplied JavaScript imports or WebAssembly System Interface (WASI) functions.
Why the HTTP Content-Type matters
Browsers do not render a .wasm file as a page. Web applications fetch the bytes and compile or instantiate the module through the WebAssembly JavaScript API. Current Chrome, Edge, Firefox, Opera, and Safari releases implement that core workflow.
For the streaming APIs, configure the server to send:
Content-Type: application/wasm
WebAssembly.instantiateStreaming() compiles and instantiates while the response arrives. MDN notes that the server must return .wasm resources as application/wasm for this optimized path.6 A generic type such as application/octet-stream can force application code to fall back to downloading the complete response and then passing its bytes to WebAssembly.instantiate().
Content-Type is a common cause.How to inspect or run a .wasm file
A normal text editor will show binary data. Use a WebAssembly-aware runtime or tool instead:
- WABT provides
wasm-validatefor validation,wasm-objdumpfor section information, andwasm2watfor a readable text representation.7 - Wasmtime runs modules outside the browser.
wasmtime foo.wasmcompiles, instantiates, and runs a compatible module, while modules with non-WASI imports need the expected host environment.8 - Browser developer tools can debug modules loaded by a web application, especially when source maps or debug information are available.
Do not rename .wasm to .wat to convert it. Use wasm2wat module.wasm -o module.wat. The reverse operation uses wat2wasm.
| File | Representation | Typical purpose | Directly human-readable? |
|---|---|---|---|
.wasm | Compact binary module | Distribution and execution | No |
.wat | WebAssembly text format | Inspection, teaching, and hand-written tests | Yes |
Source such as .c or .rs | High-level program | Development and maintenance | Yes |
Disassembly is not source recovery. A generated .wat file exposes WebAssembly instructions and structure, but original variable names, comments, types, and high-level control flow may be absent unless separate debugging data preserves some of them.
Support in Poly
Poly recognizes both the application/wasm identifier and the .wasm extension. It classifies the file as an unknown binary media category, stores it, syncs it, and makes it searchable by filename and ordinary file properties.
Poly does not execute the module, validate its bytecode, disassemble it, extract imports or exports, generate a preview, or index its compiled instructions. Opening it therefore does not provide a code view. Download the file and use WABT, Wasmtime, or the toolchain that produced it. The Poly agent also cannot inspect the binary contents.
This distinction matters because Poly itself uses WebAssembly internally in parts of its web client. That runtime implementation does not mean uploaded .wasm files are executed or understood.
Security and deployment considerations
The WebAssembly specification gives modules memory-safe, sandboxed execution semantics, and core modules have no ambient access to files, networks, or operating-system calls. A module reaches the outside world only through capabilities supplied by its embedder as imports.9
That sandbox is a boundary, not a statement that every module is trustworthy. A host can expose powerful imports, a module can consume excessive CPU or memory, and hardware side channels remain an embedder concern. Review the import surface, set resource limits, and treat an untrusted module like other untrusted executable content.
The IANA registration also notes that the format provides no built-in integrity or privacy protection.1 Use HTTPS for transport. When a particular module must be pinned, use an authenticated deployment mechanism or verify a trusted cryptographic digest before execution.
.wasm file merely because it validates successfully. Validation proves that the module follows WebAssembly's structural and type rules. It does not prove that the program's behavior is benign.Is application/wasm the same as application/octet-stream?
No. application/octet-stream is the generic media type for arbitrary binary data. application/wasm says specifically that the payload is a WebAssembly binary module, enables correct content handling, and is required for the browser streaming APIs' optimized path.
IANA lists no deprecated aliases for application/wasm.1 If a server sends a .wasm file as application/octet-stream, the bytes may still be a valid module, but the response has lost useful format information and streaming compilation may fail.
Footnotes
- Internet Assigned Numbers Authority. application/wasm Media Type Registration. ↩ ↩2 ↩3 ↩4
- WebAssembly Community Group. WebAssembly Binary Format: Modules. ↩
- WebAssembly Community Group. WebAssembly Binary Format Conventions. ↩
- 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(). ↩
- WebAssembly project. Advanced Tools: WABT. ↩
- Bytecode Alliance. Wasmtime CLI Options. ↩
- WebAssembly Community Group. WebAssembly Introduction and Security Considerations. ↩