.wasm MIME type
WebAssembly moduleapps & binaries
application/wasmWebAssembly binaries. The type is required for streaming compilation.
| MIME type | application/wasm |
|---|---|
| Extensions | .wasm |
| Content-Type | application/wasm |
| Compress in transit? | Yes — enable gzip or Brotli |
| File signature | 00 61 73 6D (.asm) |
Good to know
WebAssembly.instantiateStreaming()throws "Incorrect response MIME type. Expected 'application/wasm'" if the server sends anything else.- Wasm compresses well; serve it with gzip or Brotli.
Serve .wasm files with the right type
The response header to send:
Content-Type: application/wasm
Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:
nginx (inside the types block in mime.types)
application/wasm wasm;
Apache (.htaccess or server config)
AddType application/wasm .wasm
Express
res.set("Content-Type", "application/wasm");Python
import mimetypes
mimetypes.add_type("application/wasm", ".wasm")HTML file input
<input type="file" accept=".wasm,application/wasm">
Check it
See what a server sends for a file, and what type a local file really is by its contents:
curl -sI https://example.com/file.wasm | grep -i '^content-type:' file --mime-type file.wasm
Frequently asked questions
What is the MIME type for .wasm files?
application/wasm.
What Content-Type header should a .wasm file be served with?
Content-Type: application/wasm. It compresses well, so let the server apply gzip or Brotli.
How can I tell if a file is really a .wasm?
Check its bytes rather than the extension: WASM files start with 00 61 73 6D (.asm). On the command line, file --mime-type name.wasm does this for you.
Related types
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options