What is the MIME type of .woff files?
The MIME type (media type) for Web font (WOFF) files with the .woff extension is font/woff. You may also see application/font-woff. Older web font format; WOFF2 is about 30 % smaller and supported everywhere today.
Content-Type header
Content-Type: font/woff
Server configuration
| Server | Configuration |
|---|---|
Nginx (mime.types or types {}) | font/woff woff; |
Apache (.htaccess) | AddType font/woff .woff |
IIS (web.config) | <mimeMap fileExtension=".woff" mimeType="font/woff" /> |
| Node.js / Express | res.type('woff') or res.setHeader('Content-Type', 'font/woff') |
| Amazon S3 | Set Content-Type: font/woff on the object (metadata), or pass --content-type font/woff to aws s3 cp |
Should .woff files be compressed?
No. Web font (WOFF) files are already compressed internally, so gzip or Brotli would waste CPU and barely reduce — sometimes even increase — the size. Leave font/woff 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 .woff?
font/woff. Alternatives seen in the wild: application/font-woff.How do I set the Content-Type for .woff in Nginx?
font/woff woff; is listed in the types block (usually in /etc/nginx/mime.types) and reload Nginx.