b2KIT

Typography Scale Generator

Generate a modular type scale with configurable base size, ratio, and CSS custom property output.

Tested tool guide Tested browser tools Checked August 16, 2026

What Typography Scale Generator does, with a checked example

A modular type scale is one multiplication repeated: pick a body text size and a ratio, and every heading, caption, and label is that product applied step by step. This tool turns those two numbers into a full set of CSS custom properties, with sample text at each size so the rhythm can be judged before pasting. The surprise for most people: the golden ratio is not the right default. At a 16px base, 1.618 sends the second step to about 26px and the third past 42px; for most interfaces 1.25 or 1.333 keeps headings large without stranding body text.

Worked example

A concrete input and expected output from the current implementation.

Input

Base 16px, ratio 1.25 (major third), steps -2 to +6

Expected output

-2: 10.24px | -1: 12.8px | 0: 16px | 1: 20px | 2: 25px | 3: 31.25px | 4: 39.06px | 5: 48.83px | 6: 61.04px

Each step multiplies the previous one by the ratio: 16 x 1.25 = 20, 20 x 1.25 = 25, and so on up to 61.035 rounded to 61.04. Below the base, division gives 12.8 and 10.24. Two-decimal rounding is why 39.0625 appears as 39.06.

How the result is produced

1

The multiplication

Step 0 is the base size, usually the body text. Each step above multiplies the previous one by the ratio: step 1 is base times ratio, step 2 is base times ratio squared. Steps below the base divide instead. With base 16 and ratio 1.25 the upward run is 20, 25, 31.25, 39.06, 48.83, 61.04; downward, 12.8 and 10.24.

2

From numbers to CSS

Every computed size becomes a custom property, emitted in px and rem: a rem value is the px value divided by the root font size, so 31.25px is 1.9531rem on a 16px root. The tool renders sample text at each step so the visual rhythm can be judged before copying; the pasted block of properties then supplies every text size the stylesheet needs.

Good uses

  • Bootstrapping a new project's design tokens: generate the scale once, paste the properties into a tokens file, and every text size on the site comes from one source of truth.
  • Replacing an ad hoc pile of font sizes. A page currently using 12, 13, 14, 15, 16, 18, 21 and 24px looks calmer when all of those come from one generated scale, because the sizes finally relate to each other.
  • Matching the scale's tempo to the content. Dense dashboards and long documents read well at a tight ratio (1.2 to 1.25); marketing and editorial pages can carry 1.5 or wider for dramatic display sizes.

Limits and checks

  • The displayed values are rounded. The tool shows two decimals, so 39.0625px appears as 39.06px. Regenerating from rounded numbers drifts slightly over many steps; keep the generated tokens as the source of truth rather than retyping values.
  • The ratio is meaningless without the base. A 1.25 scale starting at 14px and a 1.25 scale starting at 18px are different scales. Changing the base after the fact shifts every step and quietly breaks layouts already sized against the old tokens.
  • Proportion is not legibility. With base 16 and ratio 1.25, the lowest step is 10.24px, below comfortable reading size for most interfaces, and wide ratios push the top steps into display-only territory. Check the smallest and largest steps against real content before adopting the scale.

Common questions

Which ratio should I pick?

There is no best ratio. Dense interfaces and long documents read well at 1.2 to 1.333, where headings stay proportional to body text; marketing and editorial pages can take 1.5 or 1.618, which gives dramatic display sizes but few usable middle steps. Generate the scale, look at the preview, and switch until the rhythm fits.

The sizes come out as odd decimals like 31.25px. Should I round them?

Yes. Rounding to whole or half pixels is standard practice and the difference is not perceptible, because what matters is the proportion, not the exact value. If you round, do it once in the token definitions rather than in each usage, and treat the scale as a starting grid you can deliberately break.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools