CSS Clamp Generator
A fluid clamp() value for font-size, spacing or any size property, scaling between two viewport widths -- with a simulated-viewport slider so you can see the exact interpolated value at any width without resizing the window. Presets, randomize, and export to CSS, Tailwind, SCSS or React.
What this tool does
Builds a fluid clamp(min, preferred, max) value —
the modern way to scale font size, spacing, or any dimension
smoothly with viewport width instead of jumping between fixed
sizes at media-query breakpoints — by computing the correct
slope-and-intercept vw formula from two size/
viewport pairs.
The math, done for you
Given a minimum size at a minimum viewport width and a maximum
size at a maximum viewport width, the tool derives the linear
equation between them and expresses it as the
calc()-free Xpx + Yvw preferred value
clamp() actually needs — the same calculation that's easy to get
wrong doing it by hand.
Simulating any viewport width
A simulated-viewport slider shows the exact interpolated value at any width between (and beyond) the min/max bounds, with a live numeric readout and a real preview element sized or scaled to match — so a specific breakpoint's value can be checked without actually resizing the browser window.
Works for more than font-size
Seven properties are supported — font-size, padding, width, height, gap, line-height, and letter-spacing — with the preview adapting to show text, a sized box, or spaced chips depending on which property is selected.
Presets and randomizing
Five presets — H1 Heading, Body Text, Section Padding, Card Gap, and Container Width — cover common fluid-sizing needs, plus a randomize button for quick exploration.
Getting the CSS out
Export as plain CSS, a Tailwind arbitrary-value class, SCSS, or a React inline style object, copyable with one click.
Privacy
Everything runs locally in your browser -- nothing you build is sent to a server.