Fluid value settings
Both bounds must share one unit — the formula needs them comparable. They are converted to px for the maths (1rem = 16px, 1em = 16px), then re-emitted in the unit you picked. Viewport widths are always px.
Live preview
Fluid heading that scales between your two bounds
Resize the window — the clamp() expression re-resolves on every viewport change, with no media queries needed.
Detecting the viewport width…
The preview uses the generated clamp() value directly as an inline style, so it behaves exactly like the rule you copy.
Generated CSS
/* clamp() generator — generated by InstantTools.site */
/* slope = (32px − 16px) / (1280px − 320px) = 0.0167 px per px */
/* intercept = 16px − 0.0167 × 320px = 10.6667px */
.fluid-type {
font-size: clamp(1rem, 1.6667vw + 10.6667px, 2rem);
}
245 characters
The clamp() formula, step by step
slope = (max value − min value) ÷ (max viewport − min viewport) intercept = min value − slope × min viewport result = clamp(min value, slope × 100vw + intercept px, max value)
Current numbers
- slope = (32px − 16px) ÷ (1280px − 320px) = 0.0167
- intercept = 16px − 0.0167 × 320px = 10.6667px
- clamp() = clamp(1rem, 1.6667vw + 10.6667px, 2rem)
clamp() needs no media queries, but browsers clamp it to the min/max bounds, so text can never fall below 16px or rise above 32px.