Fluid clamp() between two viewport widths, verified at real widths
Type Scale Generator
Turn one base size and one ratio into a consistent set of font sizes you can paste into :root.
Loading tool…
How to use type scale generator
Enter the base size, usually your body text size.
Choose a ratio from minor second to golden ratio, or type a custom one.
Set how many steps go above and below the base and how they are named.
Optionally make it fluid between two screen widths, then copy the custom properties.
What this tool does
- Offers the common musical ratios: 1.067, 1.125, 1.2, 1.25, 1.333, 1.414, 1.5 and 1.618, plus custom.
- Outputs rem or px, named by number (-1, 0, 1) or by size (sm, base, lg).
- Fluid mode uses a different base and ratio on large screens and writes a clamp() for every step.
- Previews every step at its real size with your own sample text.
How the result is verified
Each step is shown in px next to its CSS value; dividing any step by the one below it gives back the ratio you chose. Fluid steps use the same clamp() maths as the clamp generator.
Frequently asked questions
Which ratio should I pick?
Smaller ratios such as 1.125 or 1.2 suit dense interfaces and long reading. Larger ones such as 1.333 or 1.5 give dramatic headings for marketing pages, and grow very fast after a few steps.
Why make the scale fluid?
On a phone, big jumps between heading sizes waste space. A fluid scale uses a smaller ratio on small screens and a larger one on wide screens, moving smoothly in between.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
Fluid font size and line height with a device table and zoom check
Split sizes by 1.618 and build a golden ratio type scale
px, rem and em both ways with any root size, plus bulk CSS rewrite
Spacing tokens from a base unit, ratio or list as CSS, Tailwind or JSON