ZapKit

Type scale generator

Build a consistent set of font sizes from one base size and a ratio, preview them with your own text, and copy CSS ready for a design system.

What is a type scale?

A type scale is a set of font sizes where each step is the previous one multiplied by the same ratio. Instead of choosing 18, 22 and 31 pixels at random, sizes relate to each other the way notes in music do, which makes a page's headings and text feel deliberate and balanced.

Enter a base size and pick a ratio from minor second to golden ratio. The generator lists every step with its pixel and rem size, previews it with your own words, suggests line heights, and can make the whole scale fluid with clamp().

How to use the Type scale generator

  1. 1.Set base and ratio

    16 px with a ratio like 1.25 is a common starting point.

  2. 2.Choose the steps

    How many sizes above and below the base, and rem or px.

  3. 3.Copy the CSS

    Custom properties for each size and its line height.

Example: a 1.25 scale from 16 px

Base 16 px, major third ratio (1.25), rem units:

sm
12.8px (0.8rem)
base
16px (1rem)
lg / xl
20px / 25px
2xl / 3xl
31.25px / 39.06px

size = base × ratio^step

Each heading level is a quarter bigger than the one below, giving a calm, readable hierarchy.

Fluid sizes with clamp()

Turn on fluid sizes to use a smaller base and ratio on phones and a larger one on desktops. Each step becomes a clamp() value that grows smoothly between 360 px and 1280 px wide screens, so headings shrink on phones without media queries.

Line heights are suggested per size: roomy 1.5 for body text, tightening to 1.1 for large display headings, which keeps big type from looking loose.

Frequently asked questions

Which ratio should I pick?

1.2 to 1.25 suits text-heavy sites and apps; 1.333 to 1.618 gives dramatic headings for marketing pages.

Why use rem instead of px?

rem sizes follow the reader's browser font setting, which helps people who need larger text.

What are the step names?

T-shirt sizes like sm, base, lg and 2xl, similar to many CSS frameworks. Rename them freely.

Can I share my scale?

Yes. Every setting is stored in the page address.

More Developer tools