Typography tool
Type Scale Calculator
One base size and one ratio produce every heading level you need. The table gives you px for designers and rem for developers, plus suggested line heights.
Inputs
Scale
| Token | Pixels | rem | Line height |
|---|
Preset ratios follow the classic musical-interval naming used in modular scales (1.125 = Major Second, 1.25 = Major Third, 1.618 = Golden Ratio).
How to use it
- Set your base body size — 16px is the safe default for long-form reading on the web; 18–20px works for reading-heavy editorial pages.
- Leave the root at 16px unless your codebase changes html { font-size }; that value determines the rem conversion.
- Pick a ratio. Interfaces usually need 1.125–1.25 (subtle), marketing pages can carry 1.333–1.618 (dramatic).
- Copy the px column into design tokens and the rem column into CSS custom properties. Both columns describe the same numbers.
How it is calculated
A modular scale is a geometric progression. Each step multiplies the previous size by the same ratio, which is what makes the hierarchy feel rhythmically even.
size(n) = base × ratio ^ n rem(n) = size(n) / root line-height ≈ 1.2 for display sizes (≥ 32px) line-height ≈ 1.5 for body sizes (14–20px)
The line-height suggestion is a starting point, not a rule: the longer your line length and the smaller your text, the more leading it needs. A 72-character measure usually wants 1.6–1.7 at small sizes.
Worked example
With a 16px base, a 16px root and the Golden Ratio (1.618):
h3 = 16 × 1.618^1 = 25.9 → 26px → 1.625rem h2 = 16 × 1.618^2 = 41.9 → 42px → 2.625rem h1 = 16 × 1.618^3 = 67.8 → 68px → 4.25rem
Three steps already reaches 68px, which is why 1.618 suits poster-like layouts and rarely a dense app UI. Try switching the select to Major Third (1.25) and compare: h1 lands near 39px, which is far easier to fit inside a dashboard.
Where this works, and where it does not
Geometric scales are excellent for establishing predictable hierarchy in web interfaces and documents. They are the backbone of most design token sets.
They assume your typefaces have similar optical sizing and x-height behaviour. Two different families at the same px value do not look the same size, so always check pairing in context — see the Font Pairing Finder and the type guides. This tool also does not generate fluid clamp() values; treat the output as your breakpoint anchor points.