TTKTheTextKit

Type Scale Calculator

Choose a base font size and a ratio, and get a whole scale of sizes, each one the one before multiplied by the ratio. Pick a ratio from a minor second to the golden ratio or type your own, choose how many steps go above and below the base, and see every size in pixels and rem with a preview. Copy the scale as CSS custom properties or SCSS variables, and check which step a size you already use sits at. Everything runs in your browser.

Step 0. Body text is often 16 px.

Browsers use 16 px unless it is changed.

Show sizes in the code as
SteppxremPreview
661.043.8147Aa
548.833.0518Aa
439.062.4414Aa
331.251.9531Aa
2251.5625Aa
1201.25Aa
0161Aa
-112.80.8Aa
-210.240.64Aa

28 px is between step 2 and step 3 (2.51).

In a modular type scale every size is the one before it multiplied by a fixed ratio, so a size at step n is the base size times the ratio to the power n. A step of 0 is the base, positive steps are larger and negative steps are smaller. With a base of 16 px and a ratio of 1.25 the sizes go 16, 20, 25, 31.25 and 39.06. Most of the named ratios come from musical intervals, rounded to the decimals designers use: a major third is 1.25 and a perfect fifth is 1.5. The golden ratio is about 1.618. A small ratio gives sizes that are close together, which suits dense interfaces, and a large one gives strong contrast for headings. Sizes in rem are the pixel size divided by the root size, so they follow the reader's own font size setting. Rounding is done only for display, and the code uses up to 2 decimals for px and 4 for rem. Everything runs in your browser.

Related Tools

[5 suggestions]

About the Type Scale Calculator

In a modular type scale the size at step n is the base size times the ratio to the power n. Step 0 is the base, positive steps are larger and negative steps are smaller. With a base of 16 px and a ratio of 1.25, a major third, the sizes go 16, 20, 25, 31.25 and 39.06 px, and one step down is 12.8 px. Most of the named ratios come from musical intervals, rounded to the decimals designers use: a minor second is 1.067, a major second 1.125, a minor third 1.2, a major third 1.25, a perfect fourth 1.333, an augmented fourth 1.414, a perfect fifth 1.5, and the golden ratio is about 1.618. A small ratio gives sizes that are close together, which suits dense interfaces, and a large one gives strong contrast between headings and text. Sizes in rem are the pixel size divided by the root size, 16 px unless you change it, so with rem the text follows the reader's own font size setting. The code uses up to 2 decimals for px and 4 for rem, and the numbers are rounded only for display. The step checker takes a size in pixels and gives its step, a whole number when the size is on the scale.

What is a modular type scale?▾

A set of font sizes where each size is the previous one multiplied by a fixed ratio. A base of 16 px and a ratio of 1.25 gives 16, 20, 25, 31.25 and so on, so the sizes always relate to each other in the same way.

Which ratio should I choose?▾

A small ratio such as 1.125 or 1.2 gives sizes close together and suits dense screens. A larger one such as 1.5 or 1.618 gives strong contrast for headings. Try a few and look at the preview.

How do I get sizes in rem?▾

Divide the pixel size by the root size, normally 16. So 20 px is 1.25 rem. The tool shows both and can write the code in either unit.

Can I add steps below the base size?▾

Yes. Set the steps below the base, up to 8, and each one divides by the ratio, so with a ratio of 1.25 the step below 16 px is 12.8 px.

Is my data uploaded?▾

No. The scale is calculated in your browser and nothing you enter is sent anywhere.