System fonts and web fonts: what is the difference?
A system font is one already installed on the visitor's device. A web font is a file your page sends along. You don't need the second kind, but it's worth knowing what each one costs.
What each one means
- System font. It's already on the device, so there's nothing to download. The catch is that there are only a handful of fonts you can rely on being available across all common systems.1 Those are often called web-safe fonts.
- Web font. Your page points to a font file, and the browser downloads it as the page loads. This lets you use fonts beyond the web-safe set.1
- Generic family. This is a plain keyword like
seriforsans-serifthat means "any suitable font of this kind". It should be the last item in your list.2
How the browser chooses
The browser works down your list. It picks the first font that's installed or that can be downloaded.2 If none of your named fonts is available, the generic family at the end takes over.
That's why the end of the list matters. It's your safety net. Without a sensible generic family there, a visitor whose device lacks your named fonts could see something you never planned for, and the page might look odd.
Side by side
| System font | Web font | |
|---|---|---|
| Needs a download | No | Yes, a font file |
| Available on every device | Only a handful can be relied on1 | You name the file, the browser downloads it2 |
| Licence to check | Check the font's own terms | Yes, before you upload1 |
What happens while a web font loads
A browser can't show your web font until the file arrives. What it does in the meantime is up to a setting called font-display.
blockgives a short period where text is invisible, using an invisible fallback font.3swapgives an extremely small block period and an infinite swap period.3 In plain words, the text shows quickly in a fallback and switches when the font arrives.
You might notice the text change shape at that moment. A fallback font with similar proportions makes the jump less obvious.
Services and your own files
You can host the font files yourself, or use an online font service that serves them for you. Most of these services are subscription-based, and Google Fonts is the notable exception.1 Check each service's own terms before you rely on one.
A cautious way to decide
- Start with system fonts and a generic fallback. Look at the page.
- If you still want a particular look, add one web font for one job, such as headings.
- Keep web font files to a minimum.1
- Check the licence first. The licence guide shows how.
Many small sites are fine with step one. If the page reads well, you've saved yourself a download and a licence to track. The wider checklist is in the first-step guide.
Where the facts come from
- Web fonts, MDN Web Docs
- font-family, MDN Web Docs
- font-display, MDN Web Docs