Typographic Scale Generator

Pick a musical ratio and a base font size to generate a mathematically harmonious type scale. Copy ready-to-use CSS custom properties or a Tailwind config block. Fluid clamp() mode for responsive sizes. Nothing uploaded.

Modular scale ? CSS variables Fluid clamp() ? Tailwind config export 9 ratios

Scale Preview

Statistics

Steps
-
Ratio
-
Size range
-
Base
-

Generated Code

Learn more: modular type scales and fluid sizing

The math behind a modular scale

A modular scale multiplies a base size by a fixed ratio once per step, so each size is base * ratio^step. With a 16px base and the Perfect Fourth ratio (1.333), the steps are 16, 21.33, 28.43 and 37.90px. Each step grows by the same proportion, not by the same number of pixels.

The generator offers nine ratios, from Minor Second (1.067) to Octave (2.0). By default it builds 5 steps above the base and 2 below, so a Perfect Fourth scale runs from 9px up to 67.34px. Rem values divide each size by the root size, 16px unless you change it.

Blake Crosley's piece on typography systems says that, following Robert Bringhurst, harmonious type relationships follow ratios found in music, naming the perfect fourth (1.333), perfect fifth (1.5) and golden ratio (1.618). Crosley's own scale uses a custom progression of roughly 1.17 to 1.18 instead of a standard ratio.

Why fluid sizing uses clamp() instead of a fixed value

A fluid step scales smoothly with the viewport instead of jumping at a breakpoint. The CSS function clamp(MIN, VAL, MAX) resolves as max(MIN, min(VAL, MAX)), as MDN explains.

For each step the generator sets the minimum to 75% of the size. The size then grows in a straight line between 320px and 1440px viewport widths. A 28px step becomes clamp(1.313rem, 1.188rem + 0.6250vw, 1.750rem).

The 75% minimum applies to every step, including the 16px body size, which shrinks to 12px on a 320px screen. If you want body text fixed, use the non-fluid output for the base step.

How the steps are named

There are three naming styles: t-shirt (2xs, xs, sm, base, lg), Tailwind and numeric. The base size always gets the name base, however many steps you generate below it, and sizes past the end of a list keep counting (3xs, 7xl) instead of repeating a name.

Numeric names are base, up-1 and down-1, because a plus sign is not allowed in a CSS custom property name. The Tailwind output is a fontSize object for your config.

Type scale chart from a 16px base

Sizes in pixels for six common ratios, from two steps below the base to five above. Divide by 16 for rem.

Font size in px by ratio and step, 16px base
Step1.1251.21.251.3331.51.618
-212.611.110.29.07.16.1
-114.213.312.812.010.79.9
0 (base)16.016.016.016.016.016.0
+118.019.220.021.324.025.9
+220.323.025.028.436.041.9
+322.827.631.337.954.067.8
+425.633.239.150.581.0109.7
+528.839.848.867.3121.5177.4

The columns are Major Second, Minor Third, Major Third, Perfect Fourth, Perfect Fifth and the Golden Ratio. A Major Third scale puts a level-two heading at 25px and a level-one at 31.3px, while the Perfect Fifth reaches 54px at step three.

Choosing a ratio by how big the jump gets

Three steps up from a 16px base, Minor Third gives 27.6px (1.73 times the base), Perfect Fourth gives 37.9px (2.37 times) and the Golden Ratio gives 67.8px (4.24 times). Octave doubles every step, so three steps reach 128px.

Smaller ratios keep dense interface text close together. Larger ratios suit pages with a few big headings.

FAQ

Which ratio should I pick?

Pick by how far the largest heading should sit from body text. From a 16px base, three steps up is 27.6px with Minor Third, 37.9px with Perfect Fourth and 67.8px with the Golden Ratio. Smaller ratios suit dense interface text and larger ones suit editorial or marketing pages.

What's the difference between a t-shirt scale and a numeric scale?

Both name the same computed sizes. T-shirt names (xs, sm, base, lg, xl) read naturally in design tools. Numeric names (down-2, down-1, base, up-1) make each step's distance from the base explicit. The base step is always called base.

Do I need clamp() support in every browser I target?

MDN lists clamp() as Baseline widely available, in browsers since July 2020. For anything older, use the non-fluid rem output and add breakpoint overrides yourself.

Last reviewed: October 5, 2026

Link to this tool

Sharing or citing this calculator? Copy a link in the format you need. You're free to quote and cite anything on this page.

Share card: a Perfect Fourth type scale grows by 1.333 times at each step from a 16 pixel base
Plain URL
https://bentoutils.com/apps/typographic-scale-generator/
HTML link
<a href="https://bentoutils.com/apps/typographic-scale-generator/">Typographic Scale Generator</a>
Markdown link
[Typographic Scale Generator](https://bentoutils.com/apps/typographic-scale-generator/)
Image link
<a href="https://bentoutils.com/apps/typographic-scale-generator/"><img src="https://bentoutils.com/public/og/typographic-scale-generator-v1.png" alt="Typographic Scale Generator" width="600" height="315"></a>
Citation
Typographic Scale Generator. BentoUtils. October 5, 2026. https://bentoutils.com/apps/typographic-scale-generator/