← All Tools

CSS Clamp Generator Formatter🔒 100% local

Generate responsive clamp() values. Privacy-first, no server uploads, no tracking.

Related Tools

Border Radius PreviewBox Shadow GeneratorCode Heatmap

Builds a font-size: clamp(...) declaration from two or three comma-separated values. With three values they are copied straight into clamp(min, preferred, max) as typed. With two pixel values it computes the linear slope between a 320px and a 1200px viewport, writes the middle term as vw units plus a rem offset, and prints a short explanation of how the clamp behaves. No preview is rendered and the values are not stored - the CSS string and its notes are the whole output.

How to use it

  1. Enter either three values (min, preferred, max) or two pixel values (min, max) in the input box.
  2. Press Process. The declaration is printed under === CSS clamp() ===, ready to paste.
  3. If you gave two values, read the middle term as slope + offset: the vw part grows with the viewport and the rem part holds the starting size.
  4. Copy Output keeps the declaration and the explanation.

Worked example

1rem, 2vw, 3rembecomes=== CSS clamp() === font-size: clamp(1rem, 2vw, 3rem);

Three values are passed through unchanged; the explanation below the declaration is fixed text in both modes.

16px, 32pxbecomesfont-size: clamp(1rem, 1.82vw + 0.64rem, 2rem);

Computed by the tool's own maths: slope is (32-16)/(1200-320) = 0.01818, written as 1.82vw, and the offset is 16 - 0.01818 x 320 = 10.18px, rounded to 0.64rem.

8px, 40pxbecomesfont-size: clamp(0.5rem, 3.64vw + 0.23rem, 2.5rem);

A real output and a real defect: here the offset is negative, 8 - 0.03636 x 320 = -3.64px, but the plus sign is hard-coded, so this clamp grows slightly faster than asked.

When to use it

What it does not do