Modular Type Scales Explained: Ratios, Font Sizes and Building a Hierarchy
Look at a well-designed website and the font sizes feel related: headings step down in a steady rhythm, and nothing looks randomly chosen. Often that’s because the sizes come from a modular type scale, a sequence where each size is the previous one multiplied by a fixed ratio. It’s a simple idea that removes most guesswork from typography.
How a modular scale works
Pick a base size, usually your body text (16px is the default in browsers). Pick a ratio. Multiply up for larger sizes and divide down for smaller ones:
With a base of 16px and a ratio of 1.25:
| Step | Calculation | Size |
|---|---|---|
| −2 | 16 ÷ 1.25 ÷ 1.25 | 10.24 px |
| −1 | 16 ÷ 1.25 | 12.8 px |
| 0 (base) | 16 | 16 px |
| +1 | 16 × 1.25 | 20 px |
| +2 | 20 × 1.25 | 25 px |
| +3 | 25 × 1.25 | 31.25 px |
| +4 | 31.25 × 1.25 | 39.06 px |
| +5 | 39.06 × 1.25 | 48.83 px |
Because each step grows by the same proportion, the sizes feel harmonious. The difference between steps is also relative, which matches how we perceive size: going from 16 to 20px feels similar to going from 40 to 50px.
The idea was popularised for the web by Tim Brown’s “More Meaningful Typography” (2011) and his Modular Scale calculator, building on centuries of typographic practice where printers worked with traditional size sequences.
Choosing a ratio
Many common ratios are named after musical intervals, because a musical interval is also a frequency ratio:
| Ratio | Name | Character | Good for |
|---|---|---|---|
| 1.067 | Minor second | Very subtle steps | Dense data apps |
| 1.125 | Major second | Subtle | Dashboards, admin tools |
| 1.2 | Minor third | Balanced | Product UI, documentation |
| 1.25 | Major third | Clear hierarchy | Most websites |
| 1.333 | Perfect fourth | Strong | Marketing sites, blogs |
| 1.414 | Augmented fourth | Bold | Editorial, landing pages |
| 1.5 | Perfect fifth | Dramatic | Headline-led layouts |
| 1.618 | Golden ratio | Very dramatic | Posters, hero sections |
Small ratios give you many usable sizes close together; large ratios give strong contrast but grow huge quickly. With a golden ratio scale, step 5 from 16px is already over 170px. The type scale generator above previews each ratio with your own sample text.
How many sizes do you need?
Fewer than you think. Most interfaces work well with five to seven sizes:
- a small size for captions, labels and metadata,
- body text,
- one or two subheading sizes,
- two or three heading sizes.
Every extra size makes it harder to keep the design consistent. If you find yourself needing a size between two steps, that’s often a sign the hierarchy should be expressed with weight, color or spacing instead.
Size isn’t the only tool for hierarchy
Typographic hierarchy comes from contrast in several properties:
| Property | Example |
|---|---|
| Size | 32px heading vs 16px body |
| Weight | Bold heading, regular body |
| Color | Dark heading, mid-grey metadata |
| Case and spacing | Small uppercase labels with letter spacing |
| Space | More space above a heading than below it |
A modest ratio combined with weight and spacing often produces a cleaner hierarchy than a dramatic ratio alone.
Mobile versus desktop
A ratio that looks great on a wide screen can make mobile headings enormous. A common solution is to use a smaller ratio on small screens (say 1.2) and a larger one on desktop (say 1.333), and interpolate between them with CSS clamp(). Our guide to fluid typography with clamp() shows the formula. Body text barely changes; headings scale smoothly.
px versus rem
Define your scale in rem units: 1rem equals the root font size, 16px by default. If a user increases their browser’s default font size for readability, every rem-based size scales with it. Pixel sizes don’t respond to that setting. Our px vs rem guide explains the details.
Rounding
Scales produce numbers like 31.25px or 39.06px. Browsers handle fractional sizes fine, so there’s no technical need to round. Rounding to whole pixels (or to multiples of 2 or 4) can make design files and handoff tidier. Both approaches are fine; consistency is what matters.
Line height goes with size
As font size increases, line height (as a ratio) should decrease. Body text reads best around 1.5; large headings look better around 1.1–1.25, because big type already has visually large gaps between lines. Use unitless line heights so they scale with each size. Our line height calculator helps choose values.
From scale to tokens
Turn the final sizes into named tokens:
:root {
--text-sm: 0.8rem;
--text-base: 1rem;
--text-lg: 1.25rem;
--text-xl: 1.563rem;
--text-2xl: 1.953rem;
--text-3xl: 2.441rem;
}Names like sm, base and xl (as used by Tailwind CSS) are easy to remember and don’t need renaming if you change the ratio later.