Type scale generator

A modular type scale is a set of font sizes built by multiplying one base size by a fixed ratio, so every step keeps the same visual rhythm. This free generator turns a base size plus a ratio like 1.25 or 1.618 into a ready-to-copy font-size scale as CSS variables or Tailwind classes.

A type scale is a set of font sizes where each step is the previous one multiplied by a fixed ratio; pick a base size and ratio below to preview the scale and copy it as CSS or Tailwind.

Live preview

  • h148.83px / 3.0519rem

    The quick brown fox

  • h239.06px / 2.4413rem

    The quick brown fox

  • h331.25px / 1.9531rem

    The quick brown fox

  • h425px / 1.5625rem

    The quick brown fox

  • h520px / 1.25rem

    The quick brown fox

  • base16px / 1rem

    The quick brown fox

  • small12.8px / 0.8rem

    The quick brown fox

  • xs10.24px / 0.64rem

    The quick brown fox

CSS variables

:root {
  --step-5: 3.0519rem;
  --step-4: 2.4413rem;
  --step-3: 1.9531rem;
  --step-2: 1.5625rem;
  --step-1: 1.25rem;
  --step-0: 1rem;
  --step--1: 0.8rem;
  --step--2: 0.64rem;
}

Tailwind config

theme: {
  extend: {
    fontSize: {
        "h1": "3.0519rem",
        "h2": "2.4413rem",
        "h3": "1.9531rem",
        "h4": "1.5625rem",
        "h5": "1.25rem",
        "base": "1rem",
        "small": "0.8rem",
        "xs": "0.64rem",
    },
  },
},

How a modular type scale works

Each step in the scale follows the formula size = base × ratio^step. The step is the distance from your base size: step 0 is the base itself, step 1 is one multiplication up, step -1 is one step down. Starting at 16px with a 1.25 ratio gives 16 × 1.25 = 20px, then 20 × 1.25 = 25px, then 31.25px, 39.06px and 48.83px. Because every size comes from the same ratio, the jump between each heading level stays visually consistent across the page.

Which ratio should you choose?

Smaller ratios keep sizes close together and suit information-dense screens; larger ratios create more dramatic contrast and suit pages with a strong headline.

RatioNameBest for
1.067Minor secondTight UI where every size must stay close
1.125Major secondDense apps and dashboards
1.2Minor thirdDashboards and product interfaces
1.25Major thirdWebsites and blogs
1.333Perfect fourthArticle pages and marketing sites
1.5Perfect fifthLanding pages with big headlines
1.618Golden ratioBold marketing pages and hero sections

Once you have the sizes, make each step fluid with the CSS clamp() calculator. To convert a px step into rem by hand, use the PX to REM converter, and to pick typefaces that suit the scale open the font pairing finder, and fill your scale with text from the lorem ipsum generator.

Frequently asked questions

What is a good type scale ratio?

For dense apps and dashboards, 1.125 or 1.2 keeps steps close together so labels and data stay compact. For websites and blogs, 1.25 or 1.333 gives a clear heading-to-body jump. For marketing pages with big headlines, 1.5 or the golden ratio 1.618 creates dramatic contrast between the hero title and body text.

Should font sizes be in rem or px?

Use rem for the scale itself. Rem sizes follow the visitor's browser font-size setting, so text still grows when someone raises their default size for readability. The generator takes a px base because designs are usually specified in px, then converts every step to rem using the root size you enter.

How many sizes does a type scale need?

Most interfaces need five to seven usable sizes: a small caption, body text, a lead paragraph, two or three heading levels and an optional display size. Fewer sizes keep hierarchy consistent; the generator lets you add steps up and down from the base so you can preview the exact set you need.

More typography & unit tools

Color tools

Image tools

CSS generators

Image & SVG tools

More free tools

All free tools