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
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.
| Ratio | Name | Step 1 | Step 5 | Typically used for |
|---|---|---|---|---|
| 1.067 | Minor second (16:15) | 17.07px / 1.067rem | 22.09px / 1.381rem | Dense UI, dashboards, data tables |
| 1.125 | Major second (9:8) | 18px / 1.125rem | 28.83px / 1.802rem | Compact apps, admin tools, small screens |
| 1.2 | Minor third (6:5) | 19.2px / 1.2rem | 39.81px / 2.488rem | Product UI and documentation |
| 1.25 | Major third (5:4) | 20px / 1.25rem | 48.83px / 3.052rem | All-round default for apps, blogs, sites |
| 1.333 | Perfect fourth (4:3) | 21.33px / 1.333rem | 67.42px / 4.214rem | Marketing pages, articles, clear hierarchy |
| 1.414 | Augmented fourth (√2) | 22.63px / 1.414rem | 90.51px / 5.657rem | Editorial layouts with bold headings |
| 1.5 | Perfect fifth (3:2) | 24px / 1.5rem | 121.5px / 7.594rem | Landing page heroes, few steps |
| 1.618 | Golden ratio | 25.89px / 1.618rem | 177.44px / 11.09rem | Display type, posters, big contrast |
| 2 | Octave (2:1) | 32px / 2rem | 512px / 32rem | Extreme 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.