TXT · Text & Data tools

Typography Scale Calculator

Scale Ratio

Visual Preview

48.83px
Heading H1
39.06px
Heading H2
31.25px
Heading H3
25px
Heading H4
20px
Heading H5
16px
Body text
12.8px
Heading SMALL
10.24px
Heading XS
CSS Variables

Harmonic typography

A modular scale multiplies a base font size by a constant ratio to generate a mathematical sequence. Instead of picking heading sizes randomly, using a calculated scale ensures a consistent visual rhythm across your entire web project. The output provides a structured set of variables from h1 down to xs text.

Base size and ratios

Set the base size to match your default body text, typically 16px. The ratio determines the contrast between headings. A smaller ratio, like the Minor Third (1.200), keeps sizes close together, making it ideal for dense interfaces or mobile screens. A larger ratio, like the Golden Ratio (1.618), creates massive contrast between the body text and h1, which works well for expressive marketing pages.

CSS variables and rem units

The calculator outputs a :root block containing CSS custom properties (variables) for each level of the scale. The values are calculated in rem units (assuming a 16px root), which preserves accessibility by allowing the text to scale if a user changes their browser’s default font size.

Visual preview

The live preview maps the calculated sizes to a visual hierarchy, so you can test the rhythm before copying the code. Adjust the ratio until the difference between your h1 and body text feels balanced for your layout.

Frequently Asked Questions

It calculates a set of font sizes by multiplying a base size (like 16px) by a ratio (like the Golden Ratio). It outputs CSS variables in rem units for h1 through h6.

A modular scale is a sequence of numbers created by multiplying a base number by a constant ratio. It creates a harmonious rhythm for typography.

Typically, use your main body text size, which is commonly 16px. The scale will calculate heading sizes relative to this base.

The Golden Ratio (1.618) creates dramatic contrast suitable for marketing sites, while the Major Third (1.250) or Minor Third (1.200) offers tighter spacing better suited for dense dashboards or UI layouts.

Yes, the tool generates a ready-to-use block of CSS variables with rem units for h1 through h6, small, and xs sizes.

No. All calculations are performed directly in your browser.

Explore Our Tools

Browse all tools