DevToolsmith

WOFF MIME Type

font/woff is the MIME type for WOFF web fonts. Here is the Content-Type header to send, the file signature, and how to configure servers and code.

MIME type
font/woff
Extensions
.woff
Content-Type header
font/woff
Registered
Yes, with IANA
Compress with gzip
No, it is already compressed
Category
Fonts

About WOFF font files

The first web font format, compressed with zlib. Every browser that supports WOFF also supports WOFF2, so a WOFF fallback in @font-face is only needed for very old browsers. The font/ top-level type was registered in 2017 (RFC 8081); before that, application/font-woff was used.

Other types seen for these files: application/font-woff , application/x-font-woff . Accept them when reading uploads, but send font/woff yourself.

File signature

WOFF files start with 77 4F 46 46 ("wOFF"). 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 .woff with the right Content-Type

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

Set the type in code

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

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

Accept .woff uploads

HTML
<input type="file" accept=".woff,font/woff">

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

  • .woff2 (font/woff2): WOFF2 font
  • .ttf (font/ttf): TrueType font
  • .otf (font/otf): OpenType font

Sources

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

Frequently asked questions

What is the MIME type for .woff files?

font/woff. You may also see application/font-woff, application/x-font-woff, which are older or unofficial; send font/woff. The full header is "Content-Type: font/woff".

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

Web servers pick the type from the file extension using a table (mime.types in nginx and Apache). If .woff 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 WOFF?

Look at the first bytes rather than the extension or the type the browser reports, which both come from the file name. WOFF files start with 77 4F 46 46 ("wOFF"). The MIME type lookup on this site reads them for you when you drop a file on it.