What is the MIME type of .webm files?
The MIME type (media type) for WebM video files with the .webm extension is video/webm. Open VP8/VP9/AV1 video format supported by all modern browsers.
Content-Type header
Content-Type: video/webm
Server configuration
| Server | Configuration |
|---|---|
Nginx (mime.types or types {}) | video/webm webm; |
Apache (.htaccess) | AddType video/webm .webm |
IIS (web.config) | <mimeMap fileExtension=".webm" mimeType="video/webm" /> |
| Node.js / Express | res.type('webm') or res.setHeader('Content-Type', 'video/webm') |
| Amazon S3 | Set Content-Type: video/webm on the object (metadata), or pass --content-type video/webm to aws s3 cp |
Should .webm files be compressed?
No. WebM video files are already compressed internally, so gzip or Brotli would waste CPU and barely reduce — sometimes even increase — the size. Leave video/webm out of your compression configuration.
Why the MIME type matters
Browsers decide what to do with a response — render, run, play or download — from the Content-Type header, not the file extension. With X-Content-Type-Options: nosniff, a wrong type causes stylesheets and scripts to be blocked outright. For uploads, never trust the type sent by the client; check the file’s content (its magic bytes) on the server.
Frequently asked questions
What is the MIME type for .webm?
video/webm.How do I set the Content-Type for .webm in Nginx?
video/webm webm; is listed in the types block (usually in /etc/nginx/mime.types) and reload Nginx.