Typography scale generator
Generate a modular type scale from a base size and ratio. Outputs rem values, CSS custom properties, and fluid clamp() expressions.
Preview
5xl76.3px
4xl61.0px
3xl48.8px
2xl39.1px
xl31.3px
lg25.0px
md20.0px
base16.0px
sm12.8px
xs10.2px
xs-28.2px
xs-36.5px
CSS custom properties
:root {
--text-xs-3: 0.4096rem; /* 6.5px */
--text-xs-2: 0.5120rem; /* 8.2px */
--text-xs: 0.6400rem; /* 10.2px */
--text-sm: 0.8000rem; /* 12.8px */
--text-base: 1.0000rem; /* 16.0px */
--text-md: 1.2500rem; /* 20.0px */
--text-lg: 1.5625rem; /* 25.0px */
--text-xl: 1.9531rem; /* 31.3px */
--text-2xl: 2.4414rem; /* 39.1px */
--text-3xl: 3.0518rem; /* 48.8px */
--text-4xl: 3.8147rem; /* 61.0px */
--text-5xl: 4.7684rem; /* 76.3px */
}Scale table
| Step | px | rem | em | Line height | Fluid clamp() |
|---|---|---|---|---|---|
| xs-3 | 6.55 | 0.4096 | 0.4096 | 1.5 | |
| xs-2 | 8.19 | 0.5120 | 0.5120 | 1.5 | |
| xs | 10.24 | 0.6400 | 0.6400 | 1.5 | |
| sm | 12.80 | 0.8000 | 0.8000 | 1.5 | |
| base | 16.00 | 1.0000 | 1.0000 | 1.5 | |
| md | 20.00 | 1.2500 | 1.2500 | 1.5 | |
| lg | 25.00 | 1.5625 | 1.5625 | 1.3 | |
| xl | 31.25 | 1.9531 | 1.9531 | 1.3 | |
| 2xl | 39.06 | 2.4414 | 2.4414 | 1.2 | |
| 3xl | 48.83 | 3.0518 | 3.0518 | 1.1 | |
| 4xl | 61.04 | 3.8147 | 3.8147 | 1.1 | |
| 5xl | 76.29 | 4.7684 | 4.7684 | 1.1 |