March 26, 20265 min read

Typographic Scale Calculator

Generate a harmonious typographic scale using modular ratios. Create font size hierarchies that feel balanced and mathematically consistent.

typography design font size design system calchub
Ad 336x280

Good typography hierarchy isn't about picking font sizes that "look right" — it's about establishing a mathematical relationship between your type sizes that creates visual rhythm and makes the hierarchy obvious at a glance. Modular scale does exactly this: starting from a base size, each level is multiplied by the same ratio, creating a scale with consistent proportional relationships.

What Is a Modular Scale?

Choose a base size (usually 16px for body text) and a ratio. Multiply the base by the ratio repeatedly to get heading sizes. Divide it to get smaller text.

Popular ratios:














RatioNameCharacter
1.067Minor SecondVery subtle, dense
1.125Major SecondCompact, editorial
1.200Minor ThirdGentle, professional
1.250Major ThirdClassic, versatile
1.333Perfect FourthBalanced, popular
1.414Augmented Fourth / √2Geometric, clean
1.500Perfect FifthBold, dramatic
1.618Golden RatioNatural, flowing
2.000OctaveVery large jumps

For UI design, the Perfect Fourth (1.333) and Major Third (1.250) are the most practical — they create clear hierarchy without heading sizes becoming too large for body copy on the same page.

How the Calculator Works

At CalcHub, enter your base font size and choose a ratio. The calculator generates a complete scale up and down from the base:

StepMultiplierSize (base 16px, ratio 1.333)
-2 (xs)1/1.333²9px
-1 (sm)1/1.33312px
0 (base)116px
1 (md)1.33321.3px → round to 21px
2 (lg)1.333²28.4px → 28px
3 (xl)1.333³37.9px → 38px
4 (2xl)1.333⁴50.5px → 50px
5 (3xl)1.333⁵67.3px → 67px
The output includes CSS custom properties, Tailwind fontSize config, and the recommended lineHeight and letterSpacing for each step.

Pairing With Line Height

Line height isn't one size fits all. As font size increases, line height ratio should decrease:

Font SizeLine Height RatioWhy
12–14px1.6–1.8Small text needs more breathing room
16–18px1.5–1.6Standard body reading
20–26px1.4–1.5Larger body/subheadings
28–40px1.2–1.3Headings
42px+1.0–1.15Display, headlines
Single-line buttons/badges1.0–1.1No multi-line wrapping
A common mistake: using a global line-height: 1.5 applied to everything including 60px headings, creating excessive vertical gaps between heading lines.

Multi-Base Scales

Complex design systems sometimes use two base sizes — like 16px body and 14px for a compact data density — each with its own scale. The calculator supports dual-base mode, generating two parallel scales that share the same ratio and can be toggled via a CSS class for dense vs comfortable layouts.

Type Scale Tokens for Design Systems

Naming conventions matter for maintenance:

:root {
  --text-xs:    0.75rem;   / 12px /
  --text-sm:    0.875rem;  / 14px /
  --text-base:  1rem;      / 16px /
  --text-lg:    1.125rem;  / 18px /
  --text-xl:    1.25rem;   / 20px /
  --text-2xl:   1.5rem;    / 24px /
  --text-3xl:   1.875rem;  / 30px /
  --text-4xl:   2.25rem;   / 36px /
  --text-5xl:   3rem;      / 48px /
  --text-6xl:   3.75rem;   / 60px /
}

This follows Tailwind's naming convention — useful if you're using Tailwind or want to align with a widely understood system.

Tips

  • Round to whole numbers. The mathematical scale gives you fractional pixels (21.3px). Round to whole px values; the visual difference is imperceptible and your code is cleaner.
  • Don't over-engineer with too many levels. Most UIs need 5–7 sizes: xs (captions), sm (supporting), base (body), lg/xl (lead text), 2xl–4xl (headings), 5xl+ (display). More than 8 levels creates choices that slow down design and development.
  • Test scale with real content. A type scale that looks balanced as swatches can look wrong in context. Paste actual body copy and real headline text into your preview.

Should I use the Golden Ratio for typography?

The Golden Ratio (1.618) produces dramatic size jumps — good for expressive editorial design, but the heading sizes become very large quickly. A 16px base with Golden Ratio hits 160px at step 6. Perfect Fourth (1.333) or Major Third (1.250) are more practical for UI design.

How do I handle paragraph and display text differently?

Long-form reading (blog posts, documentation) benefits from generous line heights (1.6–1.7) and slightly wider measure (60–80 characters per line). UI text (dashboards, forms) works better at tighter line heights (1.3–1.5) with shorter line lengths. The scale is the same; the context determines the supporting settings.

What's the right font size for mobile body text?

16px is the safe minimum on mobile — browsers prevent zooming on inputs smaller than 16px on iOS, which is a strong hint about the minimum. Many designers go to 15–16px on mobile and 16–18px on desktop for body text.

Ad 728x90