Type Scale Generator
Build a modular type scale from a base size and a ratio, with px and rem values, CSS custom properties, and live heading previews.
| Step | px | rem |
|---|---|---|
| +5 | 39.81px | 2.488rem |
| +4 | 33.18px | 2.074rem |
| +3 | 27.65px | 1.728rem |
| +2 | 23.04px | 1.44rem |
| +1 | 19.2px | 1.2rem |
| base | 16px | 1rem |
| -1 | 13.33px | 0.833rem |
| -2 | 11.11px | 0.694rem |
:root {
--font-size-up-5: 2.488rem; /* 39.81px */
--font-size-up-4: 2.074rem; /* 33.18px */
--font-size-up-3: 1.728rem; /* 27.65px */
--font-size-up-2: 1.44rem; /* 23.04px */
--font-size-up-1: 1.2rem; /* 19.2px */
--font-size-base: 1rem; /* 16px */
--font-size-down-1: 0.833rem; /* 13.33px */
--font-size-down-2: 0.694rem; /* 11.11px */
}How to generate a modular type scale
Set the base size
Enter the body font size in pixels that the whole scale is built around, such as 16.
Choose a ratio
Pick a preset ratio like minor third or golden, or type a custom multiplier to control how fast sizes grow.
Set the step range
Choose how many steps go above and below the base to cover every heading and small label you need.
Copy the scale
Copy the CSS custom properties or the full table of px and rem sizes straight into your stylesheet.
Why use this tool
Preset and custom ratios
Choose from classic scales like minor third, perfect fourth, and golden ratio, or type any custom multiplier for a bespoke rhythm.
px and rem side by side
Every step shows both pixel and rem values, computed from a root font size you control, so the numbers match your stylesheet exactly.
Steps up and down
Generate as many steps above and below the base as you need, covering large display headings down to fine print captions.
Live heading previews
Each size is rendered with real sample text, so you see the scale as a reader would before committing to it.
Copy-ready CSS variables
Export the whole scale as CSS custom properties with clean names, ready to paste into a stylesheet and reference anywhere.
Free with nothing to upload
Everything runs on your device with no account and no files leaving your browser.
About this tool
A type scale is a set of font sizes that share one consistent ratio, so the jump from body text to a heading feels deliberate instead of random. Picking each size by hand tends to drift, while a modular scale keeps the whole system in tune. This generator builds that scale for you from two simple inputs: a base size and a ratio.
The base size is your body text, usually 16 pixels. The ratio is the multiplier between neighbouring steps. A small ratio like 1.2, the minor third, gives a gentle scale that suits dense interfaces and long articles. A large ratio like 1.618, the golden ratio, produces dramatic contrast that works for landing pages and posters. Every step up multiplies by the ratio, and every step down divides by it, so the rhythm stays even in both directions.
Each row shows the size in pixels and in rem, calculated from a root font size you set. Using rem keeps your layout responsive to a reader who bumps up their default font size for comfort. You can round values for cleaner numbers or keep the exact figures for precise control.
When the scale looks right, copy it as CSS custom properties and reference the variables across your project, or grab the full table for documentation. For fluid sizes that flex with the viewport, pair this with the CSS clamp calculator, and for spacing rhythm try the golden ratio calculator.
Frequently asked questions
- What is a modular type scale?
- A modular type scale is a sequence of font sizes generated from a single base size and a fixed ratio. Each step is the previous one multiplied or divided by that ratio, which keeps the relationships between sizes consistent across a whole design.
- Which ratio should I pick?
- Smaller ratios like 1.125 or 1.2 give subtle contrast that suits text-heavy pages and app interfaces. Larger ratios like 1.5 or 1.618 create bold jumps that work well for marketing pages and headings. Start near a minor third and adjust until the previews feel right.
- Should I use px or rem?
- rem is usually the better choice because it scales with the reader browser font-size setting, which helps accessibility. This tool shows both, and you set the root font size so the rem values convert exactly against your own base.
- How many steps do I need?
- Most design systems use around four to six sizes above the base for headings and one or two below for captions and fine print. Add as many steps as your layout needs and trim the ones you never reference.
- Is my data uploaded anywhere?
- No. The scale is calculated entirely on your device as you change the inputs, and nothing is sent to a server or stored after you leave.
Related tools
CSS Clamp Calculator
Generate a responsive CSS clamp() for fluid type and spacing that scales smoothly between a min and a max size.
Golden Ratio Calculator
Split any length by the golden ratio. Enter the whole, the longer part, or the shorter part, and get the other two plus the ratio.
Ratio Calculator
Reduce a ratio to lowest terms, or solve a proportion for the one value you are missing.
Analogous Color Generator
Turn any base color into a three swatch analogous palette by rotating its hue.
Aspect Ratio Calculator
Solve the missing width or height for any aspect ratio, from 16:9 to a custom shape.
CSS Box Shadow Generator
Dial in a CSS box-shadow with live preview and copy the exact code.