Variable Fonts: One File, Every Weight You Need

A variable font packs the full range of a typeface into a single file. Weight, width, slant, italic, and optical size live as adjustable axes inside that one file, and CSS picks any value along each axis. A weight of 625 sits between Medium and Semibold. A width of 82 percent sits between condensed and normal. The browser renders the exact instance you ask for, without a separate download for each style.

The format arrived in 2016 as part of OpenType 1.8, announced jointly by Adobe, Microsoft, Apple, and Google. Ten years later it is a standard part of web typography. Google Fonts serves many families as variable fonts by default, and all modern browsers support the format. The concept is simple: one file replaces a folder of static files, and the design gains finer control over type at the same time.

That combination explains the appeal. A variable font cuts requests and file size on sites that use several weights, and it hands designers values that static fonts never offered, like a weight of 450 for body copy that reads a touch lighter than Medium. The sections below cover the five axes, the performance math, the CSS to load a variable font, and the cases where a static font still wins.

Graphic design workspace with typography tools and letterform sketches on a desk

The Five Axes You Can Control

OpenType defines five registered axes. Each one maps to a familiar CSS property, so you can use variable fonts without learning a new syntax for the common cases.

Weight, tagged wght, runs from 1 to 1000 and maps to font-weight. This is the axis most designers reach for first. Instead of choosing between Regular 400 and Medium 500, you can set 450 for body copy or 720 for a headline that needs more presence than Semibold but less than Bold. Fine steps like these let type match the hierarchy you have in mind, not the nearest named weight.

Width, tagged wdth, maps to font-stretch and squeezes or expands letterforms. Condensed widths fit more characters on narrow screens and tight navigation bars. Expanded widths give display type room to breathe. A single variable file can serve both jobs.

Italic, tagged ital, and slant, tagged slnt, cover the two ways type leans. Italic swaps in true italic letterforms where the font has them. Slant shears the roman forms to an oblique angle, and CSS expresses it as font-style: oblique followed by the angle. Optical size, tagged opsz, maps to font-optical-sizing. With font-optical-sizing set to auto, the browser picks the right rendering for the point size: sturdier strokes and wider spacing at small sizes, finer detail and tighter spacing at display sizes.

Fonts can add custom axes beyond the five registered ones. A designer might add an axis for serif length, x-height, or bounce in a display face. Custom axes use uppercase tags, and the font maker documents the range. To reach a custom axis, or any axis with no matching CSS property, use font-variation-settings, the low-level property MDN documents for this purpose. For the five registered axes, prefer the standard properties. MDN states this directly: font-variation-settings exists for cases where no basic property covers the axis, and values set through it override the matching basic properties.

Why One File Beats a Folder of Static Fonts

The old way of loading type meant one file per style. Regular, Medium, Semibold, and Bold, each with an italic partner, added up to eight files for a single family. Each file was a separate request, and font files block rendering, so the browser queued them before it could paint text with confidence.

One variable file replaces that folder. A comparison of Inter, the workhorse sans serif behind countless interfaces, put the four most common static weights at roughly 220 to 280 KB combined, against around 175 KB for the variable file covering the full weight range. The variable file costs less and covers every weight in between, not four fixed points. Google Fonts has served Inter as a variable font by default since 2020.

The savings grow with the number of styles. A Monotype experiment cited by web.dev combined 48 styles into one variable font and measured an 88 percent file-size reduction against the static set. Your site will not ship 48 styles, but the direction holds: the more weights and widths you use, the more a variable font saves. Fewer requests also simplify the loading waterfall. One download per family is easier to prioritize, cache, and preload than a handful of small files competing for bandwidth.

The same logic applies to images. I recommend the same discipline there: fewer, better-chosen assets beat a pile of small ones, which is why the comparison of AVIF, WebP, and PNG matters for any page that cares about load time. Fonts deserve the same treatment.

How to Load a Variable Font in CSS

Loading a variable font takes two declarations: one @font-face rule that declares the range, and normal CSS that picks values inside it. Google Fonts makes the first step easy. Its CSS API accepts an axis range in the request, so a single link can ask for Inter across weights 100 to 900. Self-hosting gives you the same control with a local WOFF2 file.

@font-face{ 
  font-family: "Inter";
  src: url("inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
 }
h1 {
  font-weight: 720;
}
p {
  font-weight: 450;
}

The range in font-weight tells the browser this one file covers weights 100 through 900. After that, any font-weight value inside the range works, including values like 625 that no static font offers. The font-display value of swap keeps text visible during loading by showing a fallback face first, then swapping in the variable font when it arrives.

Keep font-variation-settings in reserve. It is the escape hatch for custom axes and for values no standard property reaches. For weight, width, slant, italic, and optical size, the standard properties do the job and keep your CSS readable. A future maintainer will thank you for font-weight: 625 over a cryptic settings string.

Subsetting trims the file further. Most variable fonts ship with broad language coverage you may never use. A subset that keeps only the Latin glyphs your content needs can cut a large share of the bytes. Serve WOFF2, the compressed format every modern browser accepts, and preload the file when it renders above-the-fold text.

Where Variable Fonts Pay Off, and Where They Fall Short

Variable fonts pay off when a design uses many styles from one family. Headings, body copy, captions, and UI labels in three or four weights make the classic case. Responsive type is another: a headline can grow heavier as it grows larger, or a navigation label can condense on a narrow screen, all from the same file. Design systems gain the most, since tokens can point at precise weights instead of the nearest named stop.

The format falls short in two situations. First, a site that uses one or two weights gains little. Web.dev notes that a variable font file is often larger than a single static file, so a page with one Regular and one Bold may load fewer bytes with two static files. Second, pure performance work sometimes favors no web font at all. A system font stack downloads nothing, and for body text on a speed-critical page that can beat any font file.

Variable fontStatic font
File countOne file per familyOne file per style
Weight choicesAny value in the rangeFixed named weights
File sizeLarger than one static file, smaller than severalSmall per file, adds up fast
Fine controlWeight, width, slant, optical sizeNone beyond the named styles
Best forDesign systems, many weights, responsive typeOne or two weights, tiny budgets

Judge by your actual usage. Count the weights and styles your design loads today. Three or more weights from one family point to a variable font. One weight points to a static file or a system stack. The decision takes five minutes and the measurement takes one look at the network panel.

Variable Fonts Inside a Design System

Design systems turn variable fonts from a nice option into a working tool. Tokens can name exact weights: 400 for body, 560 for emphasis, 750 for display. Those numbers sit between the old named stops, and they stay consistent across every screen because the token, not the designer, picks the value. The guide to building a token system that scales covers the structure; variable fonts give the type tokens room to breathe.

Optical sizing earns its place here too. With font-optical-sizing set to auto, body copy at 16 pixels gets the small-size rendering and a headline at 64 pixels gets the large-size rendering, with no designer intervention and no separate optical-size variants in Figma. Small text stays sturdy and legible. Large text keeps its fine detail. The axis does work that used to require manual judgment on every size.

Weight also animates. Font-weight is an animatable property, so a hover state can thicken a label from 500 to 650, or a button can gain weight on focus. Keep the movement small and purposeful. The guide to purposeful motion in UI sets the bar: animation should confirm an action or guide attention, never decorate for its own sake. A weight shift that marks a selected tab passes that test. A pulsing headline does not.

Weight changes how readers perceive contrast as well. A heavier weight reads darker and can lift a muted color over the contrast threshold, while a light weight can drop the same color below it. Check the pairing against the color. The WCAG contrast cheat sheet gives the ratios to test against, and the dark mode design rules explain why weight choices matter more when the background goes dark. I suggest testing each weight you ship against your real palette, not an assumed one.

Frequently Asked Questions

Do all browsers support variable fonts? All modern browsers do. Support landed in Safari in 2017 and in Chrome and Firefox in 2018, and Can I Use shows global support above 97 percent. For the small share of older browsers, declare a static fallback in your font stack so text still renders, without the fine weight control.

Can I animate a variable font? Yes. Weight, width, and other axes animate through CSS transitions and keyframes like any other animatable property. A weight shift on hover or focus is the most useful case. Keep the change small and tied to a user action, and respect reduced-motion preferences.

Do variable fonts always load faster? No. One variable file beats four static files, but it loses to a single static file. The win depends on how many styles you use. Count your weights, test on a slow connection, and subset the file before you decide.

Your Next Steps With Variable Fonts

Pick one family your site already uses in three or more weights and swap it for the variable version. Declare the weight range in @font-face, set your heading and body weights to the values you want, and turn on optical sizing. Test the result on a slow connection and check the fallback in an older browser.

Google Fonts lists variable families with a filter, and the Google Fonts guide to variable fonts explains the three benefits the format offers: compress, express, and finesse. The MDN reference for font-variation-settings covers the low-level property for custom axes, the CSS-Tricks introduction to variable fonts walks through the history, and the web.dev guide covers performance in depth. The performance analysis of variable fonts adds the numbers behind the trade-offs.

Pair the new font with a second family that complements it. The font pairing basics guide shows how to pick typefaces that work together, and a variable family makes the pairing easier, since one file covers the weights the pairing needs. Start with one page, measure the result, and roll the change out from there.

Irfan is a Creative Tech Strategist and the founder of Grafisify. He spends his days testing the latest AI design tools and breaking down complex tech into actionable guides for creators. When he’s not writing, he’s experimenting with generative art or optimizing digital workflows.

Leave a Reply

Your email address will not be published. Required fields are marked *

You might also like
Empty States in UI Design: Turn Blank Screens Into Action

Empty States in UI Design: Turn Blank Screens Into Action

Color Blindness in UI Design: A Practical Guide

Color Blindness in UI Design: A Practical Guide

W3C Design Token Format: What Changed and Why It Matters

W3C Design Token Format: What Changed and Why It Matters

Font Pairing Basics: Pick Typefaces That Work Together

Font Pairing Basics: Pick Typefaces That Work Together

Dark Mode Design: Rules for Interfaces That Stay Readable

Dark Mode Design: Rules for Interfaces That Stay Readable

Web Image Formats Compared: AVIF vs WebP vs PNG

Web Image Formats Compared: AVIF vs WebP vs PNG