Tech & Digital
Type Scale Calculator (Modular Font Sizes in px and rem)
A modular type scale is a set of font sizes in which each size is a fixed multiple of the one below it. Instead of picking heading sizes by eye, a designer chooses a base size, usually the body text size such as sixteen pixels, and a ratio, then multiplies or divides by the ratio to get each step. The result is a consistent, harmonious hierarchy where headings, subheadings, body text and captions relate to one another in the same proportion. Popular ratios are borrowed from musical intervals: the minor second at about 1.067, the major second at 1.125, the minor third at 1.2, the major third at 1.25, the perfect fourth at 1.333, the augmented fourth at 1.414, the perfect fifth at 1.5 and the golden ratio at 1.618. Small ratios produce gentle steps that suit dense applications and small screens, while large ratios create bold contrast for editorial layouts and landing pages. Many responsive designs use a smaller ratio on mobile and a larger one on wide screens, so headings do not overwhelm a narrow display. For accessibility, sizes are often written in rem units, which are relative to the root font size of the page, usually sixteen pixels by default. Text set in rem grows when a user increases their browser's default font size. This calculator takes the base size, the ratio, the number of steps above and below the base and the root font size, and returns the largest size, the sizes one step up and down, and a full table of steps in pixels and rem.
How to use this calculator
- Enter your base font size, usually your body text size.
- Choose a ratio, or Custom to enter your own.
- Choose how many steps above and below the base you need.
- Enter the root font size used for rem, normally 16 px.
- Read the table and assign the steps to headings, body and small text.
Mapping steps to elements
A common approach assigns step 0 to body text, steps 1 to 5 or 6 to headings from h6 up to h1, and negative steps to captions, labels and legal text. Not every step has to be used.
Line height usually decreases as size increases: around 1.5 for body text and 1.1 to 1.3 for large headings, which keeps headings compact while body text stays easy to read.
Responsive and fluid type
Instead of fixed sizes, many sites use fluid type that scales smoothly between a minimum and a maximum with the CSS clamp() function, often with a smaller ratio at small widths and a larger one at large widths.
Whichever method you use, keep body text at least 16 px on most screens and test the scale with real content, as long headings and narrow columns can make large ratios awkward.
Formula & method
Size at step n = base × ratioⁿrem = px ÷ root font size (browser default 16 px)Ratios named after musical intervals: 1.25 = major third, 1.333 = perfect fourth, 1.5 = perfect fifthRound to whole or half pixels for the final CSS if you preferSize at step n = base × ratioⁿ and rem = px ÷ root font size.
Worked example
A 16 px base with a major third (1.25) ratio
- Step 1 = 16 × 1.25 = 20 px (1.25 rem)
- Step 5 = 16 × 1.25⁵ = 48.83 px (3.05 rem)
- Step −1 = 16 ÷ 1.25 = 12.8 px (0.8 rem)
Answer: Use 48.83 px for h1, then 39.06, 31.25, 25 and 20 px for h2 to h5, with 12.8 px for captions.
Frequently asked questions
Which ratio is most popular?
The major third (1.25) and perfect fourth (1.333) are widely used because they create clear hierarchy without very large headings. The golden ratio is dramatic and suits large displays.
What base size should I choose?
Most websites use 16 px, the browser default, for body text. Reading-focused sites often use 18 to 20 px, and dense interfaces sometimes 14 px.
What is the difference between rem and em?
rem is relative to the root element's font size, so it is the same everywhere on the page. em is relative to the parent element's font size, so nested elements can compound.
Should I round the sizes?
Browsers handle fractional pixel sizes, but many designers round to whole or half pixels for neatness. Small rounding does not break the scale's proportions.
Can I use a type scale in print?
Yes. The same method works in points for print design. Classic print scales were often based on traditional sizes such as 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 21, 24, 36, 48, 60 and 72 points.
How many steps do I need?
Most sites need five to seven sizes: body, two or three heading sizes, and one or two small sizes. Too many steps make the hierarchy less clear.