valenx. Free tools › Type scale calculator
Free tool · Calculator

Type Scale Calculator

Pick a base size and a ratio and get a modular type scale in px and rem. Preview it on your own headline and body text, check the contrast of your colors, then copy CSS variables, a Tailwind config or Figma tokens.

1. Choose your scale

Each size is base × ratiostep. The default root size is 16px, which is what browsers use unless the reader changes it. Defaults are an example, so replace them with yours.

2. Your type scale

3. Preview it and check contrast

Contrast ratio

4. Export

Figma output is Tokens Studio style JSON (font sizes in px). Tailwind output goes inside theme.extend in tailwind.config.js.

Common type scale ratios

Ratios borrow names from musical intervals. A smaller ratio gives a tight, even scale; a larger one gives bigger jumps between sizes. Values below assume a 16px base.

RatioNameStep 1Step 5Typically used for
1.067Minor second (16:15)17.07px / 1.067rem22.09px / 1.381remDense UI, dashboards, data tables
1.125Major second (9:8)18px / 1.125rem28.83px / 1.802remCompact apps, admin tools, small screens
1.2Minor third (6:5)19.2px / 1.2rem39.81px / 2.488remProduct UI and documentation
1.25Major third (5:4)20px / 1.25rem48.83px / 3.052remAll-round default for apps, blogs, sites
1.333Perfect fourth (4:3)21.33px / 1.333rem67.42px / 4.214remMarketing pages, articles, clear hierarchy
1.414Augmented fourth (√2)22.63px / 1.414rem90.51px / 5.657remEditorial layouts with bold headings
1.5Perfect fifth (3:2)24px / 1.5rem121.5px / 7.594remLanding page heroes, few steps
1.618Golden ratio25.89px / 1.618rem177.44px / 11.09remDisplay type, posters, big contrast
2Octave (2:1)32px / 2rem512px / 32remExtreme contrast, use only a few steps

The "typically used for" column is a rule of thumb, not a standard. Try a ratio on your own content in the preview above.

Type scale calculator: frequently asked questions

How is a modular type scale calculated?

Each size is the base size multiplied by the ratio raised to the step number: size = base × ratiostep. Step 0 is the base, positive steps grow and negative steps shrink. With a 16px base and a 1.25 ratio, step 1 is 20px, step 2 is 25px and step -1 is 12.8px.

What is a good ratio for a type scale?

There is no single right answer. Small ratios such as 1.125 (major second) or 1.2 (minor third) suit dense interfaces and dashboards. 1.25 (major third) and 1.333 (perfect fourth) are common for apps, blogs and marketing pages. 1.5 (perfect fifth) and 1.618 (golden ratio) give dramatic jumps that work for editorial or hero typography but climb fast, so use fewer steps.

Should I use px or rem for font sizes?

Use rem for font sizes in most cases. A rem is relative to the root font size, which is 16px by default in browsers, so rem sizes respect a user's browser font-size setting while px sizes do not. To convert, divide the pixel value by the root size: 20px / 16 = 1.25rem.

What base font size should I choose?

16px is the usual choice for body text on the web because it matches the default browser size. Going slightly larger, such as 17px to 20px, can improve long-form reading. Avoid body text smaller than 16px unless you have a specific reason.

What contrast ratio does WCAG require for text?

WCAG 2.x level AA requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text. Level AAA requires 7:1 for normal text and 4.5:1 for large text. Large text means at least 24px, or at least 18.66px (14pt) when bold. This page checks your text color against your background color using the WCAG relative luminance formula.

How do I use the exported CSS variables, Tailwind config or Figma tokens?

Copy the CSS custom properties into your :root rule and reference them with var(), for example font-size: var(--fs-2xl). For Tailwind, paste the fontSize block into theme.extend in tailwind.config.js. The Figma output is Tokens Studio style JSON that you can paste into a token set.

Are my settings stored or sent anywhere?

No. The calculator runs entirely in your browser and needs no account. The Copy link button puts your settings in the part of the URL after the # sign, which browsers do not send to servers. Anyone you share the link with can see the values and text you entered.

More free tools