Type scale generator

Pick a base size and a ratio; the tool builds a modular type scale and gives you CSS variables or Tailwind theme values.

Adjust the values to build a type scale.

Step px rem
CSS variables
Tailwind v4 theme

Questions and answers

How do I choose a type scale ratio?

1.125 and 1.2 keep headings close to body text and suit dense interfaces. 1.25 is the common middle ground. 1.333 and 1.5 create strong hierarchy for landing pages, but leave fewer usable steps between body and h1.

How many sizes does a type scale need?

Five to eight sizes cover most sites: small print, body, two or three headings, and one display size. Beyond that the steps become hard to tell apart and the team stops remembering which one to use.

Do I have to start at 16px?

16px is the browser default and the safest body size. Starting at 18px is fine for editorial sites, but set the base in the tool so the rem values match: at a 20px root, 1rem is 20px, not 16px.

What line height should go with each size?

Larger text needs tighter line height: around 1.1 to 1.2 for display sizes, 1.3 to 1.4 for headings, and 1.5 to 1.7 for body text. Line height is part of the type scale, not a separate decision.

Last updated