1. Home
  2. Design tools
  3. Modular Type Scale Calculator

Modular Type Scale Calculator

Pick a base size and a ratio and get a consistent ladder of font sizes for headings and text.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Modular Type Scale Calculator

  1. Set base size and ratio.
  2. Choose steps below and above the base.
  3. Copy the CSS variables.

Features

  • Eight named musical ratios plus custom
  • Steps below and above the base
  • px and rem for each size
  • Live sample at each size
  • CSS custom properties in rem or px
  • Adjustable root size

Supported formats

Input

  • Base size and ratio

You get

  • Table
  • CSS variables

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Modular Type Scale Calculator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • It gives sizes only, not line heights or weights.
  • Sizes are not rounded to a pixel grid.

Guide

Modular type scales: choosing a ratio and generating CSS variables

Typography looks coherent when sizes relate to each other. A modular scale makes that explicit: pick a base size and one ratio, and every other size is the base multiplied or divided by the ratio again and again. It is the same idea as musical intervals, where each note is a fixed multiple of the one before it. This calculator turns a base and a ratio into a table of sizes with a preview, and writes the CSS custom properties to use them.

How the numbers are made

Step 0 is the base size. Step 1 is the base times the ratio, step 2 is the base times the ratio squared, and so on. Negative steps divide: step −1 is the base divided by the ratio. With a base of 16 pixels and a ratio of 1.25, called the major third, step 2 is 16 × 1.25 × 1.25 = 25 pixels and step −2 is 16 ÷ 1.25 ÷ 1.25 = 10.24 pixels. There are no jumps to tune by eye, so sizes always keep the same visual relationship.

A worked example

Press Sample for base 16, ratio 1.25, two steps down and six up. The table lists step 6 at 61.04 pixels (3.815rem), step 5 at 48.83 (3.052rem), step 4 at 39.06 (2.441rem), step 3 at 31.25 (1.953rem), step 2 at 25 (1.563rem), step 1 at 20 (1.25rem), step 0 at 16 (1rem), step −1 at 12.8 (0.8rem) and step −2 at 10.24 (0.64rem). The CSS block begins :root { --step-minus-2: 0.64rem; --step-minus-1: 0.8rem; --step-0: 1rem; --step-1: 1.25rem; --step-2: 1.563rem; … and ends with --step-6: 3.815rem;. Each row can show a sample line at that size.

Choosing a ratio

Small ratios, 1.067 to 1.2, give subtle differences that suit dense applications and tables. Mid ratios, 1.25 and 1.333, are the usual choice for websites with clear headings. Large ratios, from the augmented fourth 1.414 up to the golden ratio 1.618, make dramatic headlines and need only a few steps. With the perfect fifth, 1.5, a base of 16 gives 24, 36, 54 and 81 pixels on the way up and 10.67 on the way down. The golden ratio gives 25.89, 41.89 and 67.77 pixels above 16.

Using the variables

Define the variables once and use them everywhere, for example h1 { font-size: var(--step-5); } and small { font-size: var(--step-minus-1); }. If you choose pixels as the unit the page writes px values instead, which ignore the reader’s font size preference, so rem is the better default. The root font size field defines how rem converts: leave it at 16 unless your site sets the root differently.

Making it responsive

A static scale gets too large on phones. The usual fix is to run two scales, a smaller ratio for narrow screens and a larger one for wide screens, and to blend between them with clamp(). Calculate the sizes of the small and large scales here, then feed each pair into the clamp calculator. Alternatively, limit the number of steps above the base to what the layout needs.

Edge cases

Rounding makes tiny differences: step 2 is exactly 25 pixels, but rem shows 1.563 (1.5625). The custom ratio field accepts values from 1.01 to 3. A scale is only a menu; you may still choose a nearby size by hand for an optical reason, such as a heading that wraps badly at the computed value. Check line heights separately, since larger text needs less relative line spacing.

Limits

The tool does not choose fonts, weights or colours, and it assumes a single scale. It does not set responsive breakpoints. Everything runs in your browser.

Checked against the current version of the Modular Type Scale Calculator on .

Frequently asked questions

How many steps do I really need?

Most interfaces use five or six: small print, body, a subheading and two or three heading sizes. Extra steps are rarely used, and large ratios make the top steps too big for a phone.

Should the base size be 16 pixels?

16 pixels is the usual browser default and a safe body size. Setting the base in rem keeps the scale tied to the reader preference. Use a larger base, such as 18 pixels, for long-form reading.

Which ratio should I choose?

Small ratios such as 1.125 to 1.2 suit dense interfaces. 1.25 and 1.333 suit articles. Ratios of 1.5 and above give strong contrast but need few steps, or the top size becomes too large on a phone.

What is step 0?

The base size, usually your body text. Step 1 is the base times the ratio, step 2 is the base times the ratio squared, and negative steps divide.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.