Skip to content

font/woff MIME Type — Meaning, Usage & Examples

font/woff
Extensions: .woff Class: font Spec: RFC 8081 (IANA registered)
View IANA registration ↗

font/woff means: font/woff is the registered media type for Web Open Font Format 1.0, a compressed wrapper around TrueType/OpenType fonts designed for the web. WOFF adds zlib compression and metadata to font data, reducing download size versus raw TTF/OTF while remaining widely supported. Font media types identify web font files served to browsers via @font-face. The subtype maps to a font container format, and the correct type lets browsers validate and cache fonts efficiently. Modern web delivery favors compressed WOFF2; serving fonts with a generic or wrong type can trigger download failures or CORS-related blocking. You will encounter font/woff in contexts such as web fonts served via @font-face; fallback font format for older browsers; compressed font delivery before woff2 adoption. It is commonly associated with the file extension(s) .woff. WOFF2 offers better compression (Brotli) and is preferred for modern browsers; keep WOFF as a fallback for legacy clients. Serve fonts with correct CORS headers when cross-origin, and use font-display to control text visibility during load.

Advertisement
Ad slot · ref-top

When you'll see font/woff

  • Web fonts served via @font-face
  • Fallback font format for older browsers
  • Compressed font delivery before WOFF2 adoption

How to handle it

When serving web fonts, use WOFF2 for the smallest payload, set immutable cache headers, and add Access-Control-Allow-Origin when fonts are cross-origin. Reference them in @font-face with the correct format() hint and a font-display strategy (swap or optional) to control flash of invisible text. Subset fonts to the glyphs you actually use to cut download size further. As a final checklist for font types: prefer WOFF2, subset to used glyphs, set immutable caching and cross-origin CORS headers, choose a font-display strategy to avoid invisible text, and preload the critical fonts so first paint is not delayed by late font downloads.

Notes & gotchas

WOFF2 offers better compression (Brotli) and is preferred for modern browsers; keep WOFF as a fallback for legacy clients. Serve fonts with correct CORS headers when cross-origin, and use font-display to control text visibility during load.

Examples

HTTP
HTTP/1.1 200 OK
Content-Type: font/woff
Content-Disposition: inline; filename="sample.woff"

[binary font payload: the encoded bytes of a sample .woff]
curl
curl -i -H "Accept: font/woff" https://api.example.com/v1/resource   # inspect the returned Content-Type
JavaScript (fetch)
const res = await fetch("/v1/resource", { headers: { Accept: "font/woff" } });
// verify res.headers.get("Content-Type") starts with "font/woff"
const text = await res.text();   // handle according to the declared type
Python (requests)
import requests

res = requests.get("https://api.example.com/v1/resource",
                   headers={"Accept": "font/woff"}, timeout=30)
res.raise_for_status()
assert res.headers["Content-Type"].startswith("font/woff")
with open("sample.woff", "wb") as fh:
    fh.write(res.content)   # raw bytes; use stream=True for large files

Frequently asked questions

Should I use WOFF or WOFF2?

WOFF2 compresses better and is supported by all modern browsers; use it first and offer WOFF as a fallback for very old clients. Both are registered font types under RFC 8081.

Why do my WOFF fonts fail cross-origin?

Fonts are subject to CORS. The font host must send Access-Control-Allow-Origin permitting your page's origin, or the browser blocks the font even with the correct MIME type.

Which font MIME type should I use for @font-face?

font/woff2 for modern compressed fonts (best compression, universal support), font/woff as a fallback. Older font/ttf and font/otf work but are larger. Always serve fonts with correct CORS headers when hosted on another origin.

Why do my web fonts 404 or get blocked?

Usually a wrong path, a missing CORS header on cross-origin font hosts, or an incorrect MIME type. Verify the server returns font/woff2 with Access-Control-Allow-Origin when the font lives on a CDN or another domain.

How do I avoid invisible text while fonts load?

Use font-display: swap (or optional) in @font-face so fallback text shows immediately, and preload critical WOFF2 files. This prevents the flash of invisible text that hurts perceived performance.

Advertisement
Ad slot · ref-in-article

Try the Base64 Encoder

Encode and decode Base64 with UTF-8 and URL-safe options.

Open tool →