DevToolsmith

WEBM MIME Type

video/webm is the MIME type for WebM video. Here is the Content-Type header to send, the file signature, and how to configure servers and code.

MIME type
video/webm
Extensions
.webm
Content-Type header
video/webm
Registered
No, a common convention
Compress with gzip
No, it is already compressed
Category
Video

About WebM video files

An open format with VP9 or AV1 video and Opus audio, played by all current browsers. It is also what MediaRecorder produces in Chrome and Firefox, so screen and webcam recordings uploaded from a browser are usually WebM.

File signature

WEBM files start with 1A 45 DF A3 (EBML header, shared with Matroska). The extension and the type a browser reports for an upload both come from the file name, so check these bytes on the server before trusting a file.

Serve .webm with the right Content-Type

Response header
Content-Type: video/webm
nginx (a line in the types { } block of mime.types)
video/webm webm;
Apache (.htaccess or server config)
AddType video/webm .webm
Caddy
@webm path *.webm
header @webm Content-Type "video/webm"
Check what a server sends
curl -sI https://example.com/file.webm | grep -i '^content-type'
# Content-Type: video/webm

Set the type in code

Node.js (Express)
res.set('Content-Type', 'video/webm');
// Or make the browser download it:
res.attachment('file.webm');
Python
import mimetypes

mimetypes.add_type('video/webm', '.webm')  # if your system doesn't know it
mimetypes.guess_type('file.webm')[0]  # 'video/webm'
Go
mime.AddExtensionType(".webm", "video/webm")
w.Header().Set("Content-Type", "video/webm")

Accept .webm uploads

HTML
<input type="file" accept=".webm,video/webm">

The accept attribute only filters the file picker; users can still choose another file. Listing the extension as well as the type matters, because operating systems don’t always report the type you expect.

Related types

  • .mp4 (video/mp4): MP4 video
  • .mkv (video/x-matroska): Matroska video
  • .ogg (audio/ogg): Ogg audio

More video

.mov , .avi , .m3u8 , .ts . Look up any extension or type with the MIME type lookup.

Sources

Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.

Frequently asked questions

What is the MIME type for .webm files?

video/webm. The full header is "Content-Type: video/webm".

Why does my server send the wrong Content-Type for .webm?

Web servers pick the type from the file extension using a table (mime.types in nginx and Apache). If .webm is missing from that table, they send a default such as application/octet-stream or text/plain. Add the mapping as shown on this page, then check the response with "curl -sI".

How can I check that a file really is WEBM?

Look at the first bytes rather than the extension or the type the browser reports, which both come from the file name. WEBM files start with 1A 45 DF A3 (EBML header, shared with Matroska). The MIME type lookup on this site reads them for you when you drop a file on it.