Generate fluid font sizes with CSS clamp().
font-size: clamp(1rem, 0.8239rem + 0.7512vw, 1.5rem); /* px units: font-size: clamp(16px, 13.1831px + 0.7512vw, 24px); */
| Viewport | Fluid size | rem | State |
|---|---|---|---|
| 320px | 16px | 1rem | clamped (min) |
| 375px | 16px | 1rem | scaling |
| 576px | 17.5099px | 1.0944rem | scaling |
| 768px | 18.9521px | 1.1845rem | scaling |
| 1024px | 20.8751px | 1.3047rem | scaling |
| 1280px | 22.7981px | 1.4249rem | scaling |
| 1440px | 24px | 1.5rem | scaling |
| 1920px | 24px | 1.5rem | clamped (max) |
📐 The math: fluid type scales linearly between your two viewport points. slope = (maxFs − minFs) / (maxVp − minVp) × 100 gives the growth in vw, and intercept = minFs − slope × minVp / 100 is the px offset. The preferred value intercept + slope × vw scales with the viewport, while clamp(min, preferred, max) pins it inside your font-size range. rem output uses your root font size, so the result respects user zoom preferences.
Fluid typography scales smoothly with the viewport instead of jumping at breakpoints. The modern way to do it is one line of CSS — clamp(min, preferred, max) — but computing the vw slope and rem intercept by hand is error-prone. This calculator does the algebra for you: enter your minimum and maximum font sizes and the viewport range they apply to, and get a copy-paste-ready clamp() declaration plus a table of the exact rendered size at common viewports.
Between your two viewport points the size follows a straight line: slope = (maxFont − minFont) / (maxViewport − minViewport) × 100, expressed in vw, and intercept = minFont − slope × minViewport / 100, in px. The preferred middle value intercept + slope × vw does the scaling; clamp() then guarantees the result never goes below your minimum on small phones or above your maximum on wide monitors. The scale table shows exactly where the "scaling" zone ends and clamping begins.
Browsers let users set a default font size, and sizes declared in px ignore that preference. This tool outputs the clamp in rem units (using your root font size, 16px by default), so the whole scale respects user zoom. The viewport-relative part still needs vw — mixing rem + vw inside the preferred value is exactly how clamp() is meant to be used, and it keeps both scaling and accessibility intact.
A common starting point for body text is 16px at a 375px phone up to 18–20px at a 1440px desktop; headings tolerate much wider ranges, like 28px → 48px. Avoid a slope so steep that text balloons on tablets — check the computed size at 768px in the table. And remember the range is a viewport range, not a device range: users resizing a desktop window move through the whole scale, so keep the fluid behavior pleasant at every width in between.
More tools you might find useful
Build linear, radial, and mesh gradients with live preview.
Tune box-shadow and glassmorphism visually, preview live, copy the CSS.
Turn an image into 16x16, 32x32 favicons and an Apple Touch Icon.
Re-encode JPG/WebP at 0-100 quality, fully offline, with real size stats.