Kharabeesh
On-device ع

CSS clamp() Generator

Enter the smallest and largest size and the two screen widths to get a ready CSS clamp() for fluid type or spacing, with a value table and a full fluid type scale.

Free, no sign-up Your data stays on your device Works offline after first open

The tool

Loading the tool…

How to use

  1. Enter the size on a small screen and on a large screen (in px).
  2. Set the two screen widths where scaling starts and stops.
  3. Copy the ready CSS line and check the value at each screen width.
  4. For a full type scale, open the “Fluid type scale” tab.

Privacy & how it works

Processes your data in the browser and stores nothing.

  • Engine: lightweight in-page code, no external libraries.
  • Works offline after you open it once.

Frequently asked questions

How is the value calculated?

We draw a straight line between the two points: slope = (max size − min size) ÷ (max width − min width), written as “rem constant + slope vw”. clamp() keeps the value between the minimum and maximum.

Why is there a rem part inside?

If the size were pure vw, browser zoom would not enlarge the text. The rem constant keeps zoom working, which matters for accessibility.

Why the warning when max is 2.5× min or more?

When the maximum is more than 2.5 times the minimum, users may not be able to zoom text to 200% (WCAG 1.4.4) on some screens. Reduce the range or test with zoom.

Formulas & sources

Related tools