Typography Scale Generator
Choose a base font size and a musical ratio to build a harmonious set of heading and text sizes. Preview every step at its real size, then copy ready-made CSS custom properties, a Tailwind fontSize config or a Sass map.
Last updated:
Your body text size (step 0)
Any number greater than 1, e.g. 1.3
1–10 larger sizes (headings)
0–5 smaller sizes (captions, labels)
Browser default is 16px; used to convert px to rem/em
How to use the Typography Scale Generator
- Enter your base size, usually your body text size such as 16px.
- Pick a ratio: smaller ratios suit apps and dense UIs, larger ones suit editorial pages.
- Set how many steps you need above and below the base.
- Choose the unit and naming that match your codebase.
- Copy the CSS, Tailwind or Sass code and paste it into your project.
Type scale ratios compared
Sizes for a 16px base. Each column multiplies by the ratio once per step.
| Ratio | Name | Step +1 | Step +2 | Step +3 | Step +4 | Step +5 | Best for |
|---|---|---|---|---|---|---|---|
| 1.125 | Major second | 18.00px | 20.25px | 22.78px | 25.63px | 28.83px | Dense app UIs |
| 1.2 | Minor third | 19.20px | 23.04px | 27.65px | 33.18px | 39.81px | Dashboards, docs |
| 1.25 | Major third | 20.00px | 25.00px | 31.25px | 39.06px | 48.83px | Blogs, marketing |
| 1.333 | Perfect fourth | 21.33px | 28.43px | 37.90px | 50.52px | 67.34px | Articles |
| 1.5 | Perfect fifth | 24.00px | 36.00px | 54.00px | 81.00px | 121.50px | Landing pages |
| 1.618 | Golden ratio | 25.89px | 41.89px | 67.77px | 109.66px | 177.42px | Posters, hero text |
How to apply a type scale
- Map steps to roles, not to tags. Use the variables for body text, lead paragraphs, card titles and page titles, then assign them to h1-h6 as your content needs.
- Tighten line height as size grows. Body text reads well around 1.5; large headings usually look better near 1.1-1.25. The suggested line heights in this tool follow that pattern.
- Keep small sizes readable. Avoid going much below 12px for captions and labels.
- Limit the number of sizes. Five to eight steps cover most sites; more steps make the design harder to keep consistent.
- Round for the grid if you need to. Values such as 31.25px are fine in browsers, but you can round them in your design tool for pixel-perfect mockups.
Frequently asked questions
What is a modular type scale?
It is a set of font sizes where each size is the previous one multiplied by the same ratio. With a 16px base and a 1.25 ratio you get 16, 20, 25, 31.25, 39.06px and so on. The fixed ratio makes headings feel related to each other.
Which type scale ratio should I use?
For interfaces and dashboards with many headings, 1.125 to 1.2 keeps sizes compact. Blogs and documentation often use 1.25 or 1.333. Landing pages and editorial designs with few, large headings can use 1.5 or the golden ratio 1.618.
What is the formula for a type scale?
size(n) = base × ratio^n, where n is the step number. Positive steps give larger sizes and negative steps give smaller ones: step −1 is base ÷ ratio.
Why are the ratios named after musical intervals?
The idea comes from music, where intervals like a perfect fourth (4:3 = 1.333) or a perfect fifth (3:2 = 1.5) describe frequency ratios. Designers borrowed the names because the same proportions sound and look balanced.
Should I use rem or px for font sizes?
rem is recommended for font sizes because it scales with the text size a visitor sets in their browser. 1rem equals the root font size, 16px by default, so 20px is 1.25rem.
How do I use the scale with Tailwind CSS?
Copy the Tailwind config block into the theme.extend.fontSize section of tailwind.config.js. You can then use classes like text-lg or text-3xl, which will use your scale values and line heights.
Can a type scale be responsive?
Yes. A common approach is a smaller ratio on phones and a larger one on desktops, switched with a media query, or fluid sizes using CSS clamp(). The CSS Clamp Generator on this site can turn two scales into fluid values.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.