Slope
(max - min) ÷ (maxVw - minVw)
(48 - 16) ÷ (1440 - 375)
= 0.03005 px per px
Pixels of growth per extra pixel of screen width. Multiply by 100 for the vw value, 3.005vw here, because 1vw is 1% of the viewport.
Fluid typography lets text grow smoothly with the screen instead of jumping at breakpoints. This CSS clamp() calculator turns a minimum size, a maximum size and a viewport range into one line of CSS. Copy it as plain CSS, a custom property, Tailwind v3 or v4, SCSS or a container query version, then check it in live mobile, tablet and desktop previews. The output keeps a rem term, so text respects user font settings.
Six quick steps take you from two font sizes to production-ready CSS.
Type the font size for small phones and the size for large monitors, such as 16 and 48. Pick px or rem.
Enter the width where growth starts and where it stops, such as 375 and 1440. Text stays at the minimum below the first and at the maximum above the second.
Keep the root font size at 16px unless your CSS changes the html font size. Three decimals suits almost every layout.
Use the device buttons, drag the frame handle or move the width slider. Each preview is a real iframe, so vw units resolve as on a phone.
Choose CSS, Var, SCSS, Tailwind v4, Tailwind v3 or Container query in the Output panel and press Copy.
The checker warns about vw-only values and about a maximum more than 2.5 times the minimum, which can hinder text resizing.
Plain linear interpolation, shown with the 16px to 48px example.
(max - min) ÷ (maxVw - minVw)
(48 - 16) ÷ (1440 - 375)
= 0.03005 px per px
Pixels of growth per extra pixel of screen width. Multiply by 100 for the vw value, 3.005vw here, because 1vw is 1% of the viewport.
min - slope × minVw
16 - 0.03005 × 375
= 4.732px = 0.296rem
Shifts the line through your minimum size at your minimum width, then converts pixels to rem using the root size.
intercept(rem) + slope × 100 (vw)
0.296rem + 3.005vw
= 0.296rem + 3.005vw
The middle argument of clamp(). The rem part follows the visitor's font setting, the vw part moves with the screen, so it is never vw-only.
clamp(lower, preferred, upper)
lower = 1rem, upper = 3rem
= clamp(1rem, 0.296rem + 3.005vw, 3rem)
Stops the size leaving your range. Bounds are ordered automatically, so shrinking text still produces a valid clamp().
Two sizes and two widths define a straight line, and the formula is that line in CSS. It passes exactly through both points, so each end equals your input. Rounding to three decimals shifts results by under 0.01px, as the table shows.
| Width | Exact | From CSS | Gap |
|---|---|---|---|
| 375px | 16 | 16.005 | 0.005 |
| 768px | 27.808 | 27.814 | 0.006 |
| 1024px | 35.5 | 35.507 | 0.007 |
| 1440px | 48 | 48 | 0 |
Three common situations, from input to CSS.
A landing page headline that should feel big on a phone without wrapping into five lines.
font-size: clamp(2rem, 1.296rem + 3.005vw, 4rem);
Size at viewport width
The size doubles, staying under the 2.5x guideline, so zoom still works.
Long-form reading text entered in rem: 16px on small phones, a little larger on desktops.
font-size: clamp(1rem, 0.917rem + 0.417vw, 1.25rem);
Size at viewport width
A gentle 1.25x increase keeps line lengths comfortable.
A reusable card used in a narrow sidebar and a wide grid. Its title follows the card, not the screen.
.card { container-type: inline-size; }
font-size: clamp(1.125rem, 0.639rem + 2.778cqi, 1.75rem);Size at container width
cqi resolves against the nearest container, so the card scales wherever it sits.
Short answers to what people ask most.




© 2026 UntangleTools. All Rights Reserved.