Aa

Fluid Typography — CSS clamp() Generator

Responsive font sizes without media queries

Generate CSS clamp() formulas for fluid, responsive typography. Set minimum and maximum font sizes and viewports — get a single line of CSS that scales smoothly without media queries. Preview at 320px, 768px, 1024px and 1440px.

320px
FormatMaster
16.0px
768px
FormatMaster
28.8px
1024px
FormatMaster
36.1px
1440px
FormatMaster
48.0px
CSS
font-size: clamp(1rem, 2.8571vw + 0.4286rem, 3rem);

// quick guide

Fluid typography describes font sizes that scale smoothly according to the viewport width, eliminating the need for rigid CSS media queries. This is achieved using the CSS clamp() function, which takes a minimum value, a preferred value, and a maximum value.

How to use this tool:

  • Enter your Minimum Font Size and the viewport width where it should start scaling (e.g. mobile at 320px).
  • Enter your Maximum Font Size and the viewport width where scaling should stop (e.g. desktop at 1200px).
  • Review the responsive preview that demonstrates how the text behaves across phone, tablet, and desktop viewports.
  • Copy the generated font-size: clamp(...) CSS property directly into your stylesheet.

// frequently asked questions

How does CSS clamp() work?

The CSS <code>clamp(min, preferred, max)</code> function limits a value between a defined upper and lower bound. The preferred value is typically a responsive unit like viewport width (vw). If the preferred value goes below min, clamp uses min; if it goes above max, clamp uses max.

What are the benefits of fluid typography?

It improves readability and design consistency. Instead of fonts jumping abruptly in size at specific CSS media query breakpoints, they scale fluidly and harmoniously, fitting perfectly on any screen size.

Is CSS clamp() compatible with all browsers?

Yes. All modern web browsers (Chrome, Safari, Firefox, Edge, iOS, and Android) have fully supported CSS clamp() since early 2020.