You pick a heading size by eye, 34 on Monday and 38 on Thursday, and your posts and your website slowly stop matching. A type scale ends the guessing. You choose one base size and one ratio, and every other size follows.
How to use the calculator
- Type your base size. This is your body text, and 16 px is common.
- Pick a ratio. A small one, like Major second (1.125), makes gentle steps. A big one, like Perfect fifth (1.5), makes bold jumps. Choose Custom ratio to type any number from 1.001 to 4.
- Leave the root font size at 16 unless your site changes it. It decides what 1rem equals.
- Read the table. Step 0 is your base size. Higher steps are for headings, lower steps are for small print. Each row shows px, rem, a line height and a preview of your own words.
- Tap On a phone to see the steps in a frame up to 375 px wide, at their real px size.
- Under Copy as, pick CSS variables, SCSS, Tailwind 4, a Tailwind config, design tokens or a plain table, then press Copy code.
- Copy link to this scale copies a link that opens the same scale. Reset goes back to the start.
Open More options to change how many steps go up and down, choose whole pixels instead of decimals, try a font, or type your own preview text. Open Convert px, rem and em to turn one length into the other units.
Where a type scale comes from
Printers have used a fixed set of text sizes for centuries. A modular scale does the same with one rule: each size is the one before it times a ratio. The classic ratios are named after musical steps, because designers borrowed the idea from music. Major third is 1.25, which is 5 to 4. Perfect fourth is 1.333, which is 4 to 3. Perfect fifth is 1.5, which is 3 to 2. The golden ratio is 1.618.
Why it bites when you skip it
Say your body text is 16 px and you pick a heading of 20. It looks too close to the body, so people read it as a mistake. You bump it to 21, then 22, until it looks fine on your screen. Now do that for a subheading, a caption, a quote and a button. Every choice is a small guess, and the guesses do not agree with each other. A scale makes the gap between sizes the same each time, so the page looks calm without anyone noticing why.
What this calculator does and does not do
The math is plain: size = base x ratio^step. A step of 0 gives your base size. A step of 2 gives the base times the ratio twice. A step of -1 gives the base divided by the ratio.
The line height is a simple rule, not a law. It is 1.6 up to 14 px and 1.2 from 28 px, and it moves in a straight line between. Small text needs more room between lines, and big headings need less. Use it as a start and judge it by eye.
Two details to know. First, rem is the size relative to the root font size, and em is the size relative to the parent. The converter uses the parent size you type. Second, the calculator does not pick a ratio for you. It does not check contrast or find a font. It shows your sizes, and you judge them. Everything runs in your browser. Your numbers and text never leave it.
Type scales on social media
Posts are pictures, so their text has no rem. What matters is the size of the picture. An Instagram feed picture is 1080 px wide, and a story is 1080 by 1920. A phone shrinks that picture to fit the screen, and your type shrinks with it. On a phone about 375 px wide, 30 px type on a 1080 px wide post looks like 10.4 px. Wider phones show it a little bigger.
Open More options and type 1080 as the design canvas width. A column appears that shows every step as people see it on a phone. Use the same ratio on your posts and your site, and your brand looks like one brand. The sizes of other platforms are on the social media sizes page.
FAQ
Which ratio should I pick?
Start with Major third (1.25) for most work. It gives clear steps without huge headings. Use Major second (1.125) or Minor third (1.2) for small screens and dense pages, and Perfect fourth (1.333) or the golden ratio for big, bold headlines. Pick one, try it on a real page, and change it if the top step is too big.
Why does the calculator use a 16 px root?
Browsers show text at 16 px unless the visitor changes it, so 1rem is 16 px for most people. If your site sets another root size, type it in the root field and the rem values change. Using rem means your text grows when a visitor sets a bigger default size in their browser.
Should I use the exact decimal sizes?
You can. Browsers handle values like 39.06 px fine. For design tools that want whole numbers, open More options and choose Whole pixels. The rem values then come from the whole pixels, so your code and your mockups match.
What are the --step-N variables for?
Each CSS variable holds one size, like --step-0 for your body text and --step-3 for a big heading. You write font-size: var(--step-3) in your CSS, and if you change the scale later you replace the list and nothing else.
What is the difference between rem and em?
Rem looks at the root font size, so 1.5rem is the same everywhere on a page. Em looks at the size of the parent, so 1.5em changes when it sits inside bigger or smaller text. Rem is the safer choice for a scale.
Can I share my scale with a designer?
Yes. Press Copy link to this scale and send it. The link holds only your numbers, like the base size and the ratio, so anyone who opens it sees the same scale.