01What is Typography Scale Generator?
Picking font sizes one at a time tends to end in a stylesheet with 13px, 14px, 15px and 17px all doing roughly the same job. A modular type scale fixes that. You choose a base size and a ratio, and every size is the base multiplied or divided by that ratio a whole number of times. The sizes then relate to each other in a steady, predictable way. This generator has three inputs. Base Size (px) is the body text size, meant to sit between 8 and 32 px. Scale Ratio is one of eight preset buttons named after musical intervals: Minor Second 1.067, Major Second 1.125, Minor Third 1.2, Major Third 1.25, Perfect Fourth 1.333, Augmented Fourth 1.414, Perfect Fifth 1.5 and Golden Ratio 1.618. Steps sets how many sizes you get, with up to 18. The scale always starts two steps below the base. Those two are labeled xs and sm. Then comes base, and every remaining step goes upward as lg, xl, 2xl, 3xl and so on, the same naming Tailwind uses for its font sizes. Here's the default run: 16 px, Major Third, 12 steps. You get xs 10.24px, sm 12.8px, base 16px, lg 20px, xl 25px and 2xl 31.25px. It keeps climbing to 5xl at 61.04px and 8xl at 119.21px. Each value is the previous one times 1.25, rounded to two decimals for display. A px and rem toggle switches every output. The rem values divide by 16, assuming the browser's default root size, and they show three decimals. The list previews each size with the letters Aa, capped at 48 px so huge steps don't break the layout. Below it you get two blocks. CSS Variables writes --font-size-lg style custom properties inside :root, and Copy CSS copies that block. Tailwind Config writes a fontSize object you can drop into your config, which you select and copy by hand. A few limits to keep in mind. Any size under 1 px is dropped, so a tiny base gives fewer rows than you asked for. The rem math always uses 16 even if your base is 18. The tool sets sizes only, with no line heights or letter spacing. Big ratios with many steps grow fast, and Golden Ratio at 12 steps tops out above 1,200 px. All of it is plain arithmetic in your browser, so nothing is uploaded.
Frontend developers and design system teams who want a consistent, named set of font sizes they can paste into CSS variables or a Tailwind config. The tool runs entirely in your browser, so your data never leaves your device.
02How to use Typography Scale Generator
- Enter a Base Size (px), such as 16, and the number of Steps
- Click a Scale Ratio button such as Major Third (1.25)
- Toggle px or rem to choose the output unit
- Review the size list and its Aa previews
- Click Copy CSS for the CSS Variables block, or select and copy the Tailwind Config snippet
03Worked examples
- Input:
Base 16px, Major Third (1.25), 6 steps - Result:
xs 10.24px (0.640rem), sm 12.8px (0.800rem), base 16px (1.000rem), lg 20px (1.250rem), xl 25px (1.563rem), 2xl 31.25px (1.953rem) - Two steps sit below the base and the rest above it; each step is the previous one times 1.25.
- Input:
Base 16px, Perfect Fifth (1.5), 6 steps - Result:
xs 7.11px, sm 10.67px, base 16px, lg 24px, xl 36px, 2xl 54px - A large ratio makes the small sizes drop fast; 7.11px is too small for body text.
- Input:
Base 16px, Golden Ratio (1.618), 7 steps - Result:
xs 6.11px, sm 9.89px, base 16px, lg 25.89px, xl 41.89px, 2xl 67.77px, 3xl 109.66px - Input:
Base 1px, Minor Third (1.2), 4 steps - Result:
base 1px (0.063rem), lg 1.2px (0.075rem) - Sizes under 1px are dropped, so a tiny base gives fewer rows than the number of steps asked for.
- Input:
Base 14px, Major Second (1.125), 8 steps - Result:
xs 11.06px, sm 12.44px, base 14px, lg 15.75px, xl 17.72px, 2xl 19.93px, 3xl 22.43px, 4xl 25.23px - A tight ratio keeps sizes close together, which suits a dense dashboard.
- Input:
Base 16px, Major Third (1.25), 12 steps, rem - Result:
xs 0.640rem, sm 0.800rem, base 1.000rem, lg 1.250rem, xl 1.563rem, 2xl 1.953rem, ... 8xl 7.451rem - The defaults in rem. Trimmed in the middle; the px values run from 10.24px to 119.21px.
04Common use cases
- Setting up heading and body sizes for a new design system before any components exist
- Generating a fontSize object for tailwind.config.js that keeps Tailwind's xs, sm, base, lg naming
- Replacing a pile of one-off font sizes in an old stylesheet with a small set of --font-size tokens
- Comparing a tight 1.125 ratio for a dense admin dashboard against 1.333 for a marketing site
- Converting a px-based scale to rem so headings respect the user's browser font setting
- Giving designers and developers shared names for type sizes during a handoff
05Tips
- Start with fewer steps than you think. Six to eight sizes cover most sites, and extra steps at a high ratio quickly pass any heading you would actually use.
- Small ratios like 1.125 or 1.2 suit app UIs where many sizes sit close together. Larger ones like 1.333 or 1.5 suit editorial pages with big headlines.
- rem output always divides by 16. If your root font size is something else, convert the px values yourself.
- A large ratio shrinks the bottom fast. At Perfect Fifth, xs is only 7.11px, which is too small for readable text, so give xs a different job or raise the base.
- Pair two neighbouring steps with clamp() for fluid headings that grow between them across viewport widths.
06Related concepts
modular scale, type scale, rem units, design tokens, Tailwind fontSize.
Frequently Asked Questions
What is Typography Scale Generator?
Typography Scale Generator is a free, browser-based developer tool on AIDToolStack. Generate harmonious type scales It requires no installation or sign-up and works entirely in your browser.
Is Typography Scale Generator free to use?
Yes. No sign-up, no fees and no usage cap.
Does Typography Scale Generator store my data?
No. It runs in your browser; nothing is uploaded.