Set a base size and a ratio to get every heading and text size. Preview with real fonts, then copy CSS, Tailwind or fluid clamp() code.
Design with a clear hierarchy
Design with a clear hierarchy
Design with a clear hierarchy
Design with a clear hierarchy
Design with a clear hierarchy
Design with a clear hierarchy
A type scale gives every size a reason. Start from a readable body size and let the ratio do the rest.
A type scale gives every size a reason. Start from a readable body size and let the ratio do the rest.
A type scale gives every size a reason. Start from a readable body size and let the ratio do the rest.
:root {
--font-heading: 'Inter', sans-serif;
--font-body: 'Inter', sans-serif;
--fs-h1: 3.815rem;
--fs-h2: 3.052rem;
--fs-h3: 2.441rem;
--fs-h4: 1.953rem;
--fs-h5: 1.563rem;
--fs-h6: 1.25rem;
--fs-body: 1rem;
--fs-small: 0.8rem;
--fs-caption: 0.64rem;
--lh-h1: 1.1;
--lh-h2: 1.1;
--lh-h3: 1.2;
--lh-h4: 1.3;
--lh-h5: 1.3;
--lh-h6: 1.4;
--lh-body: 1.5;
--lh-small: 1.6;
--lh-caption: 1.6;
}
A type scale picks one base size, usually the body text, and one ratio. Each step up multiplies the size by the ratio and each step down divides by it. At a 16px base and a 1.25 ratio, step 1 is 20px, step 2 is 25px and step 3 is 31.25px. Going down, step -1 is 12.8px.
This tool names the steps for you. Step 0 is body, steps above it are h6 up to h1, and steps below it are small, caption and so on. If you add more than six steps up, the extra sizes become display-1 and larger, for oversized hero text.
Line height gets tighter as text gets larger. Small text reads best at 1.5 to 1.6, large headings at 1.1 to 1.2. The suggestion for each step follows that rule, and body text never goes below 1.5.
A small ratio gives sizes that sit close together, which suits interfaces with lots of labels. A large ratio gives strong contrast between headline and body, but the top steps grow quickly. The last column shows how big step 6 gets from a 16px base.
| Ratio | Value | Step 6 | Good for |
|---|---|---|---|
| Minor second | 1.067 | 23.6px | Dense interfaces, small screens and data tables. |
| Major second | 1.125 | 32.4px | Apps and dashboards that need gentle hierarchy. |
| Minor third | 1.2 | 47.8px | Product UI and documentation with several heading levels. |
| Major third | 1.25 | 61px | A solid default for marketing sites and blogs. |
| Perfect fourth | 1.333 | 89.8px | Editorial pages and landing pages with clear contrast. |
| Augmented fourth | 1.414 | 127.9px | Bold headlines on pages with little body text. |
| Perfect fifth | 1.5 | 182.3px | Posters, hero sections and short punchy pages. |
| Golden ratio | 1.618 | 287.1px | Display-heavy layouts. Large steps get huge fast. |
If a ratio feels too big, keep the base size and lower the number of steps up instead of switching ratios. Most pages use four or five heading sizes, not ten.
--fs-h1 and --lh-h1, plus --font-heading and --font-body. Use them with font-size: var(--fs-h1).fontSize block with a line height per step, ready for theme.extend. Classes then read text-h1 and text-body.The selected Google Fonts load from Google's css2 API with display=swap. Add the same families to your own site with the link Google generates, or self-host them.
Need typefaces? Browse the best Google Fonts or see tested Google font pairings. To fill the layout while you test sizes, use the lorem ipsum generator.
A type scale is a set of font sizes where each size is the previous one multiplied by a fixed ratio. With a 16px base and a ratio of 1.25 the sizes run 16, 20, 25, 31.25 and so on. Because every size comes from the same rule, headings, body text and captions look related.
Use a small ratio such as 1.125 to 1.2 for apps, dashboards and long reading, where many sizes sit close together. Use 1.25 to 1.333 for most websites. Use 1.5 or 1.618 only when you want dramatic headlines, since each step up is a large jump.
16px is the browser default and a safe body size. Choose 17 or 18px for long articles and 14px for dense interfaces. Keep body text at 16px or above on phones so it stays readable without zooming.
Use rem. A rem is relative to the browser's root font size, so people who raise their default text size get larger text. Pixel values ignore that setting. This tool assumes a 16px root, so 1.25rem is 20px.
It makes each size grow smoothly with the viewport. You set a minimum and maximum viewport width and a smaller base size for narrow screens. Each step becomes a clamp() value that stays at its minimum on phones, at its maximum on wide screens, and scales linearly in between.
Yes. The page address updates as you change the settings, for example ?base=16&ratio=1.25&steps=6&h=Montserrat&b=Lato. Press Copy link to copy it. Anyone who opens it sees the same scale and fonts.
Zaps templates come with fonts already paired. Swap in your words and photos and post.