All Tools490+

Typography Scale Generator – Font Sizes for H1 to H5 in px and rem

Typography Scale Generator

Establish a perfect visual hierarchy for your website. Select a base size and a mathematical ratio to generate harmonious font sizes.

Scale Settings

CSS Base Conversion 1 rem = 16px
H1 48.83px 3.05rem
The quick brown fox jumps over the lazy dog.
H2 39.06px 2.44rem
The quick brown fox jumps over the lazy dog.
H3 31.25px 1.95rem
The quick brown fox jumps over the lazy dog.
H4 25.00px 1.56rem
The quick brown fox jumps over the lazy dog.
H5 20.00px 1.25rem
The quick brown fox jumps over the lazy dog.
P / Body 16.00px 1.00rem
This is your base body text. The quick brown fox jumps over the lazy dog. Good typography establishes a strong visual hierarchy and provides a graphic balance to the website.
Small 12.80px 0.80rem
Small text for captions, footer links, or fine print.

Ready-to-use CSS

Typography Scale Generator tool by VectraTools

Quick answer

Enter a base font size, such as 16px, and choose a scale ratio like Major Third (1.250). The typography scale generator multiplies the base by the ratio to give sizes for H1 to H5, body text and small text, in both px and rem, with a live preview. Press Copy CSS Variables to get ready-made CSS for your site.

Picking heading sizes by eye usually ends with numbers like 34px, 27px and 22px that do not relate to each other. The page works, but it never quite looks balanced. A type scale fixes this by building every size from one base size and one ratio, the same way musical notes are built from fixed intervals.

This typography scale generator does the maths for you. Change the base size or the ratio and all seven sizes update at once, so you can see the whole hierarchy before you write any CSS.

Scale Ratios Available

Ratio nameValueFeelWorks well for
Minor Second1.067Very subtleDense dashboards and data tables
Major Second1.125SubtleApps and admin screens
Minor Third1.200BalancedBlogs and documentation
Major Third1.250ClearMost websites (default)
Perfect Fourth1.333StrongMarketing pages and articles
Augmented Fourth1.414BoldLanding pages
Perfect Fifth1.500DramaticPortfolios and editorial layouts
Golden Ratio1.618Very dramaticPosters and hero sections

How to Use the Typography Scale Generator

The tool starts at 16px with Major Third (1.250). You can change both settings at any time.

Step 1: Set your base font size

Type your body text size in Base Font Size (px). Most websites use 16px, while 18px suits reading-heavy pages. In the screenshot, 18px with Major Third gives an H1 of 54.93px.

Base font size input in the typography scale generator

Step 2: Choose a scale ratio and compare the sizes

Open Scale Ratio and pick a ratio. The preview shows each level with its px and rem size. Switch between ratios and watch how the gap between headings grows or shrinks.

Perfect Fourth scale ratio selected with heading previews

Step 3: Copy the CSS variables

Under Ready-to-Use CSS, press Copy CSS Variables. The code sets a variable for each level, such as --text-h1, and applies them to h1 through h5, p and small.

Copying the typography CSS variables

Example Scales at 16px

These values come straight from the tool. Each level is the one below it multiplied by the ratio.

LevelMajor Third (1.250)Perfect Fourth (1.333)
H148.83px / 3.052rem67.34px / 4.209rem
H239.06px / 2.441rem50.52px / 3.157rem
H331.25px / 1.953rem37.90px / 2.369rem
H425.00px / 1.563rem28.43px / 1.777rem
H520.00px / 1.250rem21.33px / 1.333rem
Body16.00px / 1.000rem16.00px / 1.000rem
Small12.80px / 0.800rem12.00px / 0.750rem

How the Scale Is Calculated

Each size is the base size multiplied by the ratio raised to a power. Body text uses power 0, so it equals the base. H5 uses power 1, H4 power 2 and so on up to H1 at power 5. Small text uses power −1, which divides the base by the ratio once.

For H1 at 16px with Major Third: 16 × 1.255 = 16 × 3.052 = 48.83px. The rem value is that size divided by the base, so 48.83 ÷ 16 = 3.052rem.

Tips for Choosing a Type Scale

  • Use smaller ratios on mobile. A 1.333 scale can make H1 too large on a phone. Many sites use 1.2 on small screens and 1.333 on desktop.
  • Prefer rem over px. Rem sizes respect the reader's browser font setting, which helps accessibility.
  • Round if you need to. Rounding 48.83px to 48px will not break the scale.
  • Keep line height in mind. Large headings need tighter line height, around 1.1 to 1.2, while body text reads best at about 1.5 to 1.7.

Pair a typography scale generator with good font choices and your pages will look consistent from the first heading to the footer. Choose the fonts first with the font pairing tool, then set the sizes here.

Frequently Asked Questions

Is this typography scale generator free?

Yes. It is free with no sign-up and runs in your browser.

What is a typographic scale?

A set of font sizes built from one base size and one ratio, so every size relates to the others.

Which scale ratio should I use?

Major Third (1.250) suits most websites. Use a smaller ratio for dense apps and a larger one for bold marketing pages.

What base font size is best?

16px is the standard browser default and a safe choice. 18px works well for long articles.

Why does the tool give rem values?

Rem units scale with the reader's browser settings, so text stays readable for people who increase their default font size.

What does the copied CSS include?

A :root block with a variable for each size and rules that apply them to h1 to h5, p and small.

MH

Written and tested by Muhammad Hasnain

Founder of VectraTools. Behaviour described here was checked against the tool’s own output. Last reviewed: October 2026.