← Back to the lab

Type Scale Generator

Generate a modular type scale from a base size and ratio, preview it live, and export fluid clamp() CSS or design tokens for your design system.

How to use Type Scale Generator

  1. Set a base font size and a ratio (for example 16px and 1.25, a major third).
  2. Switch the mode to Fluid and set a different base and ratio for mobile and desktop, so sizes grow with the screen.
  3. Preview the scale with your own font and sample text, at any viewport width.
  4. Export the scale as CSS variables (with clamp() in fluid mode) or as design tokens in JSON, and copy it.

About Type Scale Generator

A type scale is the set of font sizes in a design system, from small captions to large headings. A modular scale multiplies each size by the same ratio, which gives the hierarchy a consistent rhythm instead of random numbers.

This type scale generator also works as a clamp() generator for fluid typography: for each step it calculates a CSS clamp() value that grows smoothly from your mobile size to your desktop size, so headings never jump abruptly between breakpoints.

What it does

  • Classic ratios from minor second to the golden ratio
  • Fluid mode: different base and ratio for mobile and desktop, output as CSS clamp()
  • Live preview with your sample text, font and viewport width
  • Export as CSS custom properties or W3C design tokens

FAQ

What is a modular type scale?

A set of font sizes where each step is the previous one multiplied by a fixed ratio, such as 1.25. It gives headings and body text a consistent, predictable hierarchy.

What is fluid typography?

Font sizes that grow smoothly with the viewport between a minimum and maximum, written with CSS clamp(), instead of jumping at breakpoints.

How does CSS clamp() work for font sizes?

clamp(min, preferred, max) keeps a value between a minimum and a maximum. For type, the preferred value mixes rem and vw, so the size grows with the viewport but never gets smaller than the min or larger than the max.

Which type scale ratio should I use?

For interfaces, 1.2 (minor third) or 1.25 (major third) keep sizes close together. For editorial or marketing pages, 1.333 (perfect fourth) or larger gives more dramatic headings.

📖 Fluid typography with CSS clamp(): a practical guide

More free tools