Visual design

Typography in UI: Type That Works

Nov 20, 2026·7 min read

Open almost any product and count the pixels: the overwhelming majority of them spell words. If text is most of the interface, then typography is most of the design, and a few disciplined decisions about scale, measure, and weight will do more for your UI than any amount of decoration.

Typography is the interface

Interfaces are made of text far more than they are made of shapes. Navigation, labels, body copy, prices, error messages, empty states, buttons, tooltips: almost everything a user reads is set in type, and almost every decision they make depends on reading it correctly. That means typography is not a finishing layer you sprinkle on at the end. It is the structure. When type is set well, people stop noticing it and simply get their task done; when it is set badly, they feel friction without ever being able to name the cause.

The good news is that type rewards restraint. You do not need a large budget, exotic fonts, or clever tricks. You need a small set of sizes that relate to each other, lines that are comfortable to read, weights that signal importance, and enough breathing room between elements. Get those right and the work looks professional almost automatically. The rest of this guide is a concrete, numbers-first walkthrough of how to do that.

One family is usually enough

The most common typographic mistake in UI is using too many typefaces. Beginners reach for a second or third family hoping it adds personality, but it usually just adds noise and a vague sense that the page was assembled from parts. A single well-chosen family, used across a range of weights and sizes, will carry an entire product and feel more coherent than any pairing. Before you add a font, exhaust what one family can do with weight, size, colour, and spacing.

If you genuinely need two, pair them for real contrast and a clear division of roles, not for subtle difference. A classic split is one family for display and headings and a second for long-form body text, so the eye can tell structure from content at a glance. The lowest-risk option is a superfamily, a single design shipped as matching serif and sans (think Source Serif with Source Sans, or IBM Plex Serif with IBM Plex Sans): the proportions, x-height, and rhythm already agree, so the pairing cannot clash.

  • Default to one family and push it with 400/500/600/700 weights before reaching for a second.
  • If you pair, give each font a distinct job: one for headings, one for body, and never swap them around.
  • Prefer a superfamily, or pair a serif with a sans whose x-height and proportions are similar.
  • Two families is a sensible ceiling for product UI; three almost always signals indecision.

The type scale and its ratio

Random sizes are the enemy of hierarchy. If your headings are 22px, 24px, and 23px, nothing reads as clearly bigger than anything else, and the layout feels muddy. The fix is a type scale: a small, fixed set of sizes generated by repeatedly multiplying a base size by a ratio. This is called a modular scale, and it gives every step a mathematical relationship to the next, which the eye reads as order.

Common ratios borrow from musical intervals. A 1.2 minor third is gentle and well suited to dense, information-heavy UI where you want many sizes close together. A 1.25 major third is a balanced, popular default. A 1.333 perfect fourth is more dramatic and works for marketing pages and bold editorial layouts where headings should really dominate. Larger ratios like the golden ratio (1.618) create striking contrast but leave awkward gaps in the middle, so they are rarely ideal for dense product screens.

Start your base at the body size you will actually read, then scale up for headings and down (sparingly) for captions. Keep the number of steps small, around six, so every size earns its place and maps to a role rather than a whim.

A worked example: a 1.25 scale

Let's build a scale from a 16px base using the 1.25 major third. Multiply repeatedly and round to whole pixels: 16 x 1.25 = 20, 20 x 1.25 = 25, 25 x 1.25 = 31.25 (round to 31), 31.25 x 1.25 = 39.06 (round to 39), 39 x 1.25 = 48.8 (round to 49). That yields a clean set of six steps: 16 / 20 / 25 / 31 / 39 / 49. Add one smaller step below the base for captions and metadata, roughly 13px (16 / 1.25), and you have a complete range from fine print to hero heading.

Now assign roles so the scale becomes a system rather than a list of numbers. The jumps are large enough that each level is unmistakably distinct, which is exactly what hierarchy needs.

  1. Choose a base size for body text, 16px or more. Everything else derives from this.
  2. Pick a ratio to match your density: 1.2 for data-dense UI, 1.25 for a balanced default, 1.333 for expressive marketing.
  3. Generate the scale by multiplying the base by the ratio repeatedly, then round each result to a whole pixel.
  4. Decide how many steps you need, around six up plus one down, and stop. More steps blur the hierarchy.
  5. Assign a role to each step: 49 hero/h1, 39 h2, 31 h3, 25 h4, 20 lead/large body, 16 body, 13 caption/metadata.
  6. Encode the scale as design tokens (named variables), and never type an arbitrary off-scale size again.

Measure and line-height

Measure is the length of a line of text, counted in characters. Lines that run too long make the eye lose its place on the return sweep; lines that are too short chop the reading rhythm into stutters. The comfortable range for body text is 45 to 75 characters per line, with roughly 66 as a classic target. The cleanest way to enforce this on the web is a character-based max-width, for example max-width: 68ch, since the ch unit is tied to the width of the font's zero character and tracks the measure directly.

Line-height (leading) controls the vertical space between lines, and it should be expressed as a unitless ratio, not a fixed pixel value. A ratio scales correctly with font size, so a 16px body and a 49px heading each get proportional spacing from the same rule; a fixed px line-height that looks right on body text will suffocate a large heading or balloon on small text. Body copy reads best at about 1.5 to 1.6. Headings are large enough that generous leading looks loose, so tighten them to roughly 1.05 to 1.15. As a general rule, line-height falls as font size rises.

  • Constrain body columns with a ch-based max-width such as max-width: 68ch to hold the measure at 45 to 75 characters.
  • Set body line-height around 1.5 to 1.6 as a unitless ratio so it scales with the font.
  • Tighten heading line-height to roughly 1.05 to 1.15; big type needs less leading, not more.
  • Never pin line-height to a fixed px value across different sizes; it breaks the proportion.

Weight, tracking, and hierarchy

Weight is your strongest and cheapest tool for hierarchy. Build your emphasis with real cut weights, 400 regular, 500 medium, 600 semibold, 700 bold, and map each to a role: 400 for body, 500 or 600 for subheads and UI labels, 700 for headings and primary actions. Crucially, only use weights the typeface actually ships. If you apply bold to a font that has no bold cut, the browser synthesises a faux-bold by smearing the strokes, and faux-italic by slanting the uprights; both look crude and hurt legibility. Choose a family with the weights you need, or pick different ones.

Letter-spacing (tracking) is a fine adjustment, not a main control. Large headings are drawn with space meant for smaller sizes, so they often read tighter and cleaner with slightly negative tracking, around -0.01 to -0.02em. The opposite is true for all-caps labels and small overlines: capitals set at default spacing feel cramped, so add slight positive tracking, roughly 0.02 to 0.08em, to let them breathe. Body text almost never needs tracking adjustment; leave it at the font's default. Above all, build hierarchy with weight and size first, and reach for colour only after those are doing their job, since colour alone is a weak and inaccessible signal of importance.

Numbers, performance, and readability

Numbers deserve special care because UI is full of them. Many fonts default to proportional, old-style figures where each digit has its own width and some dip below the baseline. That is fine in a sentence but wrong in a table: columns of prices or quantities will fail to line up. For any data that stacks vertically, switch on tabular, lining figures (via font-feature-settings 'tnum' or the font-variant-numeric property) so every digit occupies the same width and the columns align cleanly.

Web fonts cost performance, and unmanaged they cause layout shift and invisible text. Set font-display: swap so text renders immediately in a fallback and swaps to the web font when it loads, rather than hiding content. Subset the font to only the characters and scripts you use to cut file size dramatically. Prefer a variable font when you need several weights, since one file replaces many. Preload the single most critical face so it arrives early. And define a strong system-font fallback stack whose metrics are close to the web font, so the swap causes minimal cumulative layout shift (CLS).

  • Use tabular lining figures for tables, prices, timers, and anything that stacks into columns.
  • Set font-display: swap and ship a close system-font fallback to limit CLS during loading.
  • Subset fonts to the characters you actually use; preload only the one critical face.
  • Prefer a variable font to replace multiple static weight files.
  • Avoid justified text on the web: without good hyphenation it creates ugly rivers of white space.
  • Avoid long runs of all-caps; capitals have no ascenders or descenders, so words are slower to read.
  • Give paragraphs generous spacing between them so blocks of text feel like discrete thoughts, not a wall.

Common mistakes

  • Too many fonts: three or more families almost always reads as noise and indecision.
  • Sizes too close together: 22/23/24px gives you no hierarchy; use a real scale with clear jumps.
  • Lines too long: body text past about 75 characters is tiring; constrain the measure with ch.
  • Tiny, light-grey text: low-contrast fine print fails accessibility and frustrates everyone.
  • Faux bold and faux italic: synthesised styles look crude; use real cut weights the font ships.
  • Justified body text on the web: it opens rivers of whitespace without proper hyphenation; prefer left-aligned.

#ui#typography

Want an interface that looks this considered?

Tell us about your project