Most designers think about font size when text is hard to read on screen. They bump up the pixel value, adjust the line height, maybe switch to a bolder weight. But there is one axis on variable fonts that quietly makes a real difference in how readable text feels at different sizes, and most people leave it untouched: optical sizing.
Optical sizing adjusts the design details of letterforms based on their rendered size. Small text gets wider openings and more generous spacing. Large text gets tighter proportions and finer details. When you use this feature through a variable font in your UI, text at every size feels like it was drawn specifically for that context because it was.
What does optical sizing actually change in a variable font?
Optical sizing is a variation axis, usually tagged as opsz, built into a variable font file. When you adjust the value, the font modifies specific design traits:
- At small sizes (like 10–14px body text): stroke thickness increases slightly, counters (the enclosed spaces inside letters like "e" and "a") open up, letter spacing loosens, and ink traps or subtle simplifications appear.
- At large sizes (like 24px+ headings): strokes get thinner and more refined, spacing tightens, and fine details like serifs or terminals become more pronounced.
This is not the same as just changing font weight or letter-spacing manually. Optical sizing is a coordinated set of design adjustments baked into the font itself by the type designer. The shapes of the letters actually change.
Why does optical sizing matter for screen readability in UI?
Screen rendering is not the same as print. Pixels have fixed grids, sub-pixel rendering varies by operating system, and users view interfaces at wildly different distances and on different resolutions. A font that looks sharp at 48px on a heading can look muddy at 12px in a label if it was drawn with large-size proportions.
Optical sizing compensates for this. When you set the opsz axis to match the rendered size, small UI text gets the thicker strokes and open counters it needs to stay legible. Large display text avoids looking clumsy or overly heavy. The result is consistent readability across your entire interface.
According to research on reading performance, character legibility at small sizes depends heavily on the clarity of individual letterforms the distinction between "c" and "e," or "I" and "l." Optical sizing directly addresses this by widening those differentiating features at the sizes where confusion is most likely.
Does this apply to every font?
No. Only variable fonts that include an optical size axis support this behavior natively. Some well-known variable fonts with optical sizing include Amstelvar, Roboto Flex, and Source Serif 4. Not all variable fonts ship with this axis, so you need to check the font's spec before relying on it.
How do you use optical sizing in CSS?
The CSS is straightforward. You can set it as a standalone property or include it inside the shorthand font-variation-settings property.
Using the dedicated property:
font-optical-sizing: auto;
Setting auto tells the browser to match the optical size to the rendered font size automatically. Most modern browsers do this well. If you need manual control:
font-variation-settings: "opsz" 16;
The value you pass should typically match the pixel size of the text, though some fonts use different scales. Always check the font documentation for the supported range.
For a deeper breakdown of accessible font settings in general, see our guide on variable font settings for accessible web interface text.
When should you adjust optical sizing manually in your UI?
The auto value works for most cases. But there are specific situations where manual tuning helps:
- Dense dashboard text When you have table cells or data labels at 11–12px, manually setting a slightly higher opsz value (like 14) can improve legibility without increasing the actual font size.
- Large hero text A 72px heading with optical sizing auto-set to 72 might feel too delicate. Bumping it down slightly (like 60) can give the heading more visual weight.
- Dark mode Light-on-dark text can look heavier than dark-on-light at the same weight. Adjusting optical size down slightly in dark themes can counterbalance this effect.
What mistakes do designers make with optical sizing?
Several common issues come up when teams start using this feature:
- Ignoring it entirely. Many teams load a variable font with an opsz axis and never set it, missing out on free readability gains.
- Setting it once globally. Optical sizing is meant to respond to the rendered size. If you set
opsz: 14at the root level and never change it, your headings and body text will all use the same optical adjustment defeating the purpose. - Confusing it with font size. The opsz value is not a substitute for your font-size declaration. It adjusts the letterform design, not the rendered dimensions.
- Not testing across devices. Optical sizing behavior can differ slightly between browsers and operating systems. What looks clean in Chrome on macOS might render differently in Firefox on Windows. You need to test.
- Using fonts without an opsz axis and expecting it to work. If the font does not include the axis, the CSS property does nothing. Check your font files before building around this feature.
How does optical sizing interact with other variable font axes?
Optical sizing works best in combination with other axes. In a UI context, you are often adjusting weight (wght), width (wdth), and optical size together. The key relationship to understand:
- Setting
opszto a small value increases apparent stroke thickness, so you might pair it with a slightly lowerwghtto avoid text looking too heavy. - At large display sizes, a higher
opszthins strokes out, which pairs well with a slightly higherwghtfor headings that need presence.
This interplay is exactly why variable fonts are so useful for interface typography. You can fine-tune readability at every scale without switching font files. Our breakdown of the best variable fonts for mobile app interfaces covers which families support these combined axes well.
Does the browser handle optical sizing automatically?
In most modern browsers, yes if you set font-optical-sizing: auto and the font supports it. Chrome, Safari, Firefox, and Edge all handle this now. The browser reads the rendered font-size value and maps it to the corresponding opsz value in the font file.
However, automatic behavior means you are trusting the browser's interpolation. For critical UI text onboarding flows, form labels, error messages, navigation manual control lets you dial in exactly the right balance.
What is a practical workflow for adding optical sizing to a UI project?
- Audit your current font. Check if it has an opsz axis. Tools like Wakamai Fondue or the command-line tool
fonttoolscan inspect variable font axes. - Set the baseline. Add
font-optical-sizing: autoto your base text style. This is your starting point. - Test at every text size in your UI. Check body text, captions, labels, buttons, and headings. Look for letters that blur together or feel off-weight compared to the rest.
- Manually adjust problem sizes. If a specific size looks off, use
font-variation-settings: "opsz" Xon that text element to correct it. - Test in both light and dark themes. Optical sizing adjustments that work in one mode may not work in the other.
- Check performance. Variable fonts are a single file, so there is no performance penalty for using optical sizing. But make sure you are not loading separate static font files for different sizes, which defeats the purpose.
Quick checklist for optical sizing in your next UI project
- Confirm your variable font includes an
opszaxis - Set
font-optical-sizing: autoas a baseline on body text - Manually tune opsz for small caption text (under 13px) and large display text (over 32px)
- Pair opsz adjustments with weight and width axes for balanced results
- Test across light mode, dark mode, and at least two browsers
- Check mobile rendering separately smaller screens expose optical sizing issues faster
- Document your opsz values in your design system alongside your type scale
Best Variable Fonts for Mobile App Interface Typography in 2024
Open Source Variable Fonts Optimized for Dashboard Interfaces
Best Monospace Fonts for Coding in vs Code – Top Picks for Developers
Best Monospace Fonts Compared for Terminal Readability and Coding
Top Google Fonts Monospace Alternatives for Developer Portfolios
Best Monospace Web Fonts for Dark Mode Editors