Skip to content
Omnikalc

Type scale calculator: font sizes from a base size and a ratio

Enter a base font size and a scale ratio to get nine harmonious font sizes for small print, body text, headings and display text.

Updated on
Your inputs
px

Value out of range

Results

Step 0, body text

16.00 px

Step −2, small print
10.24 px
Step −1, caption
12.80 px
Step 1, large text
20.00 px
Step 2, heading 4
25.00 px
Step 3, heading 3
31.25 px
Step 4, heading 2
39.06 px
Step 5, heading 1
48.83 px
Step 6, display
61.04 px

Picking font sizes by eye leads to headings that do not quite fit together. A type scale calculator builds a modular scale from a base font size and a ratio, and gives nine sizes from small print to display text, from step −2 to step +6, so that every size relates to the others.

How the calculation works

  • A modular scale multiplies a base size by the same ratio at each step. The size at step n = base × ratio^n, where n is negative for sizes below the base.
  • Common ratios come from music: 1.125 major second, 1.2 minor third, 1.25 major third, 1.333 perfect fourth, 1.414 augmented fourth, 1.5 perfect fifth and 1.618 the golden ratio.
  • A small ratio gives a quiet scale for dense interfaces, and a large one gives strong contrast between headings and text, which suits editorial pages.
  • The output lists 9 steps, from −2 to +6, in pixels. Divide by the root size to get rem values.

Example

With a base of 16 px and a ratio of 1.25, step 1 is 16 × 1.25 = 20 px, step 2 is 16 × 1.25² = 25 px, step 3 is 31.25 px, step 4 is 39.06 px and step 5 is 48.83 px. Below the base, step −1 is 16 ÷ 1.25 = 12.8 px and step −2 is 10.24 px.

Why it matters

A consistent scale makes a page look planned and makes it easier to maintain, since every new heading uses a size that already exists. It is a quick start for a design system, a blog theme or a slide deck.

Good to know

A scale gives sizes and not line heights or spacing, which should also follow a rhythm, for instance a line height of 1.5 for text and 1.2 for headings. Check the result on real content and on a small screen, since the largest steps can be too big for a phone. Round the values if you prefer whole pixels, but keep the ratio in mind.

The golden ratio calculator gives the ratio of 1.618 for proportions and the aspect ratio calculator keeps the shape of images and screens.

Frequently asked questions

What is a type scale?

A type scale is a set of font sizes that grow by a constant ratio, so that the sizes feel related. Instead of picking each heading size by eye, you pick a base size and a ratio, and each step follows. Designers use it to keep headings, subheadings and text in proportion across a site.

Which ratio should I choose?

Small ratios such as 1.125 or 1.2 suit dashboards and apps with a lot of text, where headings should not take much room. Ratios of 1.25 to 1.333 are common for websites. Large ratios like 1.5 or 1.618 give a dramatic hierarchy that suits landing pages, magazines and posters.

Should I use all nine steps?

No. Most designs need five or six sizes: small text, body text, and three or four heading levels. Pick the steps you need and skip the rest. On small screens you can use a smaller ratio, so the large headings do not overflow.

How do I use the sizes in CSS?

Store them as custom properties or as rem values, for example 1.25rem for 20 px. Dividing by the root size of 16 px gives the rem value. For headings that adapt to the screen, a fluid size with clamp() can run between two steps of the scale.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.