Type Scale Generator

Start from your body text size, then pick a ratio or say how big your largest heading should be. Copy the sizes as CSS custom properties.

How it works

A modular scale multiplies each size by the same ratio to get the next one. At 16px and a ratio of 1.25, the steps above the body are 20, 25, 31.25, 39.06 and 48.83 pixels. Steps below divide instead: 12.8 and 10.24.

If you know how big the largest heading should be, the page solves for the ratio. 16px to 48px in 5 steps needs a ratio of 1.2457, the fifth root of 3, and the page names the nearest preset, 1.25.

The sizes are written as custom properties in rem, divided by the root size, so they follow the reader font setting. The preview draws each step in your sample text.

How to use it

  1. 1 Type your body text size, usually 16px.
  2. 2 Pick a ratio from the list, or switch to Fit my largest heading and type its size.
  3. 3 Choose how many steps you need above and below the body size.
  4. 4 Check the preview, then copy the CSS.

Good to know

  • Small ratios such as 1.125 or 1.2 suit dense interfaces and long reading. Large ratios such as 1.5 or 1.618 suit posters and landing pages with few headings.
  • Two steps below the body size is usually enough: one for captions and one for fine print.
  • On phones, a large ratio makes the top headings very big. Pair the scale with the CSS clamp() Generator to shrink them on narrow screens.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Building a type scale for a blog, from the body text up

A blog needs body text, a caption size, and headings for the post title, sections and subsections. Suppose the body is 16px, the post title should be about 48px on a laptop, and the scale should have five steps above the body. The question is which ratio gets there. Switch to Fit my largest heading and type 48, and the page works out the fifth root of 48 divided by 16, which is 1.2457. The nearest preset is the major third, 1.25.

With 1.25, the five steps are 20, 25, 31.25, 39.06 and 48.83 pixels. The top step is the post title. The fourth, 39px, is too close to it to be useful on the same page, so many designs skip it and use 31.25px for section headings and 25px for subsections. The 20px step suits a lead paragraph or a card title. Below the body, 12.8px works for captions and 10.24px for legal text, though 10px is the smallest size many readers can comfortably read.

The CSS uses rem. At a 16px root, 20px is 1.25rem and 48.83px is 3.0518rem. Writing the scale in rem means a reader who sets a larger default font size gets every step larger by the same factor, so the hierarchy stays intact. Switch the output to px only when the scale is for something that must not follow the reader setting, such as a fixed-size social image.

The ratio sets the character of the page. At 1.125 the steps are close together, which suits a dashboard full of labels where headings should not shout. At 1.5 each step is half as big again as the last, which suits a landing page with one large headline. The golden ratio, 1.618, makes the jump from body to heading dramatic: three steps up from 16px is already 67.8px. Try the sample text in the preview with your own words, because a long heading word changes how big a size feels.

The scale has limits. It is one fixed set of sizes; on a phone the top step may be too large, and the scale does not shrink it for you. Use the CSS clamp() Generator for that. It sets font sizes only, not line height, letter spacing or weight, which matter as much for how a heading reads. And a strict ratio is a starting point, not a rule: designers often nudge a step or skip one, as the blog example above does.

Frequently asked questions

Why are the ratios named after music?

They are the frequency ratios of musical intervals. A perfect fifth is 3:2, which is 1.5. A perfect fourth is 4:3, about 1.333. A major third is 5:4, which is 1.25. Designers borrowed the names because the ratios were already well known.

Which ratio should I pick?

Start from how many sizes you need and how much room there is. With six heading levels at 1.5, the top one is 11.4 times the body text, which rarely fits a phone. At 1.2 it is 3 times the body, which usually does. The Fit my largest heading mode lets you start from that limit instead.

Should I round the sizes to whole pixels?

You can, but there is little need. Browsers render fractional font sizes, and a difference of a fraction of a pixel is not visible. Rounding also breaks the ratio slightly, which is harmless.

What are the variable names based on?

They follow the names utility frameworks use: --text-base for body text, --text-sm and --text-xs below it, and --text-lg, --text-xl, --text-2xl and so on above it. Rename them to suit your system.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.