CSS & Responsive Design

CSS clamp() Font Size Generator

Generate fluid responsive typography that scales smoothly between minimum and maximum font sizes using CSS clamp().

Typography settings

px
px
px
px

Font-size presets

Root font assumption

rem values are calculated using the standard browser root size of 16px.

Generated fluid typography

Minimum

1rem

Fluid value

3.6364vw

Maximum

3rem

clamp() value

clamp(1rem, 0.2727rem + 3.6364vw, 3rem)

Copy CSS
font-size: clamp(1rem, 0.2727rem + 3.6364vw, 3rem);
Copy clamp() value
clamp(1rem, 0.2727rem + 3.6364vw, 3rem)

Live preview

Resize the browser window to see the font scale.

Fluid typography scales smoothly with the viewport.

Calculation details

Slope0.036364
Intercept4.3636px
Preferred value0.2727rem + 3.6364vw

How it behaves

Below 320px, the font is capped at 16px.

Between 320px and 1200px, the font scales fluidly.

Above 1200px, the font is capped at 48px.

About CSS clamp() Font Size Generator

CSS clamp() Font Size Generator creates fluid typography that scales smoothly between minimum and maximum font sizes across a chosen viewport range.

Input is processed locally in your browser and is not sent to Navorika.

How the calculation works

Fluid slope

Slope = (maximum font size - minimum font size) ÷ (maximum viewport width - minimum viewport width).

Viewport coefficient

The slope is multiplied by 100 to convert the fluid portion into a vw coefficient.

Preferred value

The linear intercept is combined with the viewport coefficient to create the preferred middle value used by clamp().

Final CSS

font-size: clamp(minimum size, fluid preferred size, maximum size).

How to use this calculator

  1. 1Enter the minimum and maximum font sizes in pixels.
  2. 2Enter the viewport widths where fluid scaling should begin and end.
  3. 3Review the generated clamp() expression and live typography preview.
  4. 4Copy either the complete font-size declaration or only the clamp() value.

Understanding the result

Below the minimum viewport width, clamp() prevents the text from becoming smaller than the selected minimum font size.

Between the minimum and maximum viewport widths, the generated preferred value scales the font fluidly with viewport width.

Above the maximum viewport width, clamp() prevents the text from growing beyond the selected maximum size.

Important limitations

  • The rem conversion assumes a 16px root font size.
  • The generated value controls font size only; line height, letter spacing, container width, and font metrics can also affect typography.
  • Minimum and maximum viewport widths must be different, and the maximum values must be greater than their corresponding minimum values.

Frequently asked questions

What does CSS clamp() do for font size?

It lets you define a minimum font size, a fluid preferred value, and a maximum font size in one CSS declaration.

Why use clamp() instead of media queries?

For many typography systems, clamp() allows text to scale continuously across viewport widths without requiring several breakpoint-specific font-size rules.

What does vw mean in the generated formula?

One vw equals one percent of the viewport width. The generated vw coefficient creates the fluid portion of the font-size calculation.

Does the generated font size have limits?

Yes. The first and third clamp() arguments enforce the minimum and maximum sizes.

Does Navorika send my settings to a server?

No. The calculation and preview run locally in your browser.

Related tools

Learn more

Related guides

View all guides