How to use the type scale calculator
- Set the base size, usually your body text (16px is the browser default).
- Choose a ratio. Small ratios suit dense interfaces; large ratios suit editorial pages.
- Set how many steps you need above and below the base.
- Copy the sizes as CSS variables or a Tailwind v4 @theme block.
What a modular scale is
Each size is the previous one multiplied by the same ratio: with a 16px base and 1.25, the steps are 16, 20, 25, 31.25, 39.06 and so on. Because every size relates to the others in the same way, headings and body text look like a family rather than a collection.
Choosing a ratio
- 1.125–1.2: apps and dashboards where many levels sit close together.
- 1.25–1.333: most websites and documentation.
- 1.5–1.618: editorial and marketing pages with big headlines.
To make the larger sizes shrink on phones, turn any of them into a fluid value with the clamp() generator.
Questions
Why use rem instead of px?
rem scales with the reader's browser font size setting, which respects people who enlarge text. 1rem is 16px by default.
Which ratio is best?
There is no single best one. 1.25 (major third) is a safe default; use smaller ratios for dense interfaces.