How to Build a Typography Scale for Web Design
A type scale is a set of font sizes that follow a mathematical ratio, creating visual harmony and clear hierarchy. Instead of picking arbitrary sizes, a scale ensures every heading, body text, and caption size relates proportionally to the others — just like notes in a musical scale.
What Is a Type Scale?
A type scale multiplies a base font size by a consistent ratio to generate larger and smaller sizes. With a 16px base and a 1.25 (Major Third) ratio: 16 × 1.25 = 20px, 20 × 1.25 = 25px, 25 × 1.25 = 31.25px. Going smaller: 16 / 1.25 = 12.8px. The resulting scale is: 12.8, 16, 20, 25, 31.25, 39px. Each size has a clear proportional relationship to every other size.
Common Scale Ratios
Minor Second (1.067) — very subtle differences, almost monoscale. Major Second (1.125) — gentle hierarchy, good for dense UI. Minor Third (1.2) — moderate contrast, versatile default. Major Third (1.25) — clear hierarchy, good for blogs and marketing. Perfect Fourth (1.333) — strong contrast, good for editorial. Golden Ratio (1.618) — dramatic differences, striking headlines. The Typography Scale tool lets you preview all ratios with your chosen fonts.
Implementing with CSS Custom Properties
Export your scale as CSS custom properties for consistent use:
:root {
--text-xs: 0.75rem;
--text-sm: 0.875rem;
--text-base: 1rem;
--text-lg: 1.25rem;
--text-xl: 1.563rem;
--text-2xl: 1.953rem;
--text-3xl: 2.441rem;
}Check the small end: the two smallest values above (0.75rem and 0.875rem, 12px and 14px) are not on the 1.25 scale — they are Tailwind's text-xs and text-sm. A true Major Third below 16px gives 12.8px (0.8rem) and 10.24px (0.64rem). Mixing the two is common and harmless, as long as it is a choice.
Worked Example: Do Real Design Systems Use One Ratio?
We computed the step from each size to the next in two widely used systems (values from Tailwind CSS v3's default fontSize and Material Design 3's type-scale tokens in material-web 2.2.0; script in our test folder, October 13, 2026):
| System | Sizes (px) | Step ratio range |
|---|---|---|
| Major Third (1.25) from 16px | 10.24, 12.8, 16, 20, 25, 31.25, 39.06, 48.83 | 1.25 every step |
| Tailwind CSS v3 | 12, 14, 16, 18, 20, 24, 30, 36, 48, 60, 72, 96, 128 | 1.11 – 1.33 |
| Material Design 3 | 11, 12, 14, 16, 22, 24, 28, 32, 36, 45, 57 | 1.09 – 1.38 |
Neither system uses a single ratio. Both take small steps (about 1.1–1.17) around body text, where a few pixels matter for reading and UI density, and larger steps (1.25–1.33) among display sizes, where hierarchy matters more than fine control. A pure geometric scale is a fine starting point; treat the small end and the very top as places you will adjust by eye. If you want the ratio itself to change with screen size — tighter on phones, wider on desktops — define two scales and interpolate between them with clamp(), keeping a rem term in the middle value so text still grows with browser zoom.
Choosing the Right Ratio
For content-heavy sites (blogs, documentation): use 1.2 (Minor Third) or 1.25 (Major Third) — clear hierarchy without extreme size jumps. For marketing and landing pages: use 1.333 (Perfect Fourth) or higher — dramatic headlines grab attention. For dense UIs (dashboards, admin panels): use 1.125 (Major Second) — subtle differences keep the interface compact.
