application/wasm MIME Type — WebAssembly Serving & Headers
WebAssembly binary format. A binary instruction format for a stack-based virtual machine that runs in modern browsers and Node.js at near-native speed. Used for compute-intensive applications: image processing, video codecs, machine learning, and game engines.
Used For
- Browser-side image and video processing
- Port of C/C++/Rust code to the web
- Game engines (Unity WebGL, Godot)
- Cryptography and compression libraries
HTTP Header Example
HTTP/1.1 200 OK
Content-Type: application/wasm
Cache-Control: public, max-age=31536000
[binary wasm data]Code Examples
// Express — serve .wasm with correct MIME type
// (required for WebAssembly.instantiateStreaming to work)
app.get('*.wasm', (req, res, next) => {
res.set('Content-Type', 'application/wasm')
next()
})
// Browser — load WebAssembly module
const { instance } = await WebAssembly.instantiateStreaming(
fetch('/module.wasm'), // server must return application/wasm
{ env: {} }
)
instance.exports.myFunction()
// Next.js config — enable WASM
export default {
experimental: { serverComponentsExternalPackages: ['*.wasm'] },
}Related MIME Types
Frequently Asked Questions
What is the application/wasm MIME type?
WebAssembly binary format. A binary instruction format for a stack-based virtual machine that runs in modern browsers and Node.js at near-native speed. Used for compute-intensive applications: image processing, video codecs, machine learning, and game engines.
When should I set Content-Type: application/wasm?
Set Content-Type: application/wasm on HTTP responses that contain WebAssembly data. Browser-side image and video processing.
What file extensions use application/wasm?
Files with application/wasm content typically use these extensions: .wasm.
What happens if I serve this with the wrong Content-Type?
Browsers use the Content-Type header to decide how to handle the response. Serving application/wasm content with an incorrect MIME type can cause browsers to display it incorrectly, refuse to execute it (scripts), or prompt an unintended download. Modern browsers respect X-Content-Type-Options: nosniff and will not attempt to auto-detect the type.
