CSS Font Stack Generator
Pick a style and copy a font-family list that looks right on every operating system without downloading a single font file.
Whatever the device uses for its own interface.
Almost before we knew it, we had left the ground.
The quick brown fox jumps over the lazy dog. 0123456789. Each device shows the first font in the list that it has installed, so this preview is specific to yours.
body {
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
}What a font stack is
The font-family property in CSS takes a list. The browser uses the first font in the list that the device has, so a good stack names the best match for each operating system in turn and ends with a generic family such as serif or sans-serif as a last resort.
A stack made only of installed fonts is the fastest typography there is: there is nothing to download, no flash of unstyled text and no layout shift when a web font arrives.
Adding a web font in front
If you do load a web font, put its name first and keep the system stack behind it. Visitors then see a similar-looking system font while the web font loads, and the same one if it fails to load.
Choose the stack whose style is closest to your web font. A geometric stack behind a geometric web font keeps line lengths and spacing close, so the page shifts less when the swap happens.
Common questions
Why does the preview look different on my phone and my laptop?
That is the stack working as intended. Each device shows the first listed font that it has installed, so Apple, Windows, Android and Linux users each see a different but similar typeface.
What does system-ui mean?
It is a CSS keyword for the font the operating system uses for its own menus and buttons: San Francisco on Apple devices, Segoe UI on Windows and Roboto on most Android phones.
Do font names need quotes?
Names containing spaces should be quoted. Generic keywords such as serif, sans-serif, monospace and system-ui must not be, or the browser treats them as the name of a specific font.