Modular Type Scale Generator (Ratio to CSS Variables)

Generates a modular type scale: choose a base size, a ratio and the steps above and below, and get rem custom properties plus a preview.

Use the tool

Why this tool exists

A modular scale multiplies a base size by a fixed ratio for each step, so headings and text relate to each other. Picking sizes by eye tends to give uneven jumps.

This tool gives each step in px and rem, names the variables --step-0, --step-1 and so on, and previews every size. Large ratios grow fast, so check the top steps on small screens, or combine with a clamp() generator for fluid sizes.

How to use it

  1. Set the base size and choose a ratio or enter your own.
  2. Choose how many steps go below and above the base.
  3. Review the preview.
  4. Copy the :root block.

Frequently asked questions

Which ratio should I pick?

1.2 to 1.25 suits dense interfaces. 1.333 to 1.5 suits editorial pages. Try several in the preview.

Why rem?

rem respects the user's browser font size setting, which helps accessibility.

Can I make it fluid?

Use the clamp() generator on the top steps to scale between viewport widths.