Skip to content
M2TOOLKIT

Fluid Font Size (CSS clamp) Generator

Make text scale smoothly with screen size using CSS clamp().

Use it as often as you like — it's free, with no sign-up and no limits.

  • Design
  • Free
  • No sign-up
  • Runs in your browser
  • Updated
px
px
px
px
px
ViewportFont size
320px16.00px
375px16.00px
768px19.47px
1024px21.74px
1280px24.00px
1920px24.00px

Using rem for the min and max respects users who increase their browser's default font size.

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us.

How to use the Fluid Font Size (clamp) Generator

  1. Enter the smallest and largest font size.
  2. Enter the viewport widths where scaling starts and stops.
  3. Copy the clamp() value.

What does this tool do?

clamp(min, preferred, max) keeps a value between limits. With a preferred value that combines rem and vw, text grows smoothly between two screen sizes instead of jumping at breakpoints.

Why use it?

  • Fewer media queries.
  • Smooth, consistent typography.
  • Accessible rem-based output.

Use cases

  • Fluid headings that scale between phone and desktop.
  • Responsive spacing and gaps.
  • Fewer media queries in a design system.

Example

16px at 375px wide to 24px at 1280px wide: font-size: clamp(1rem, 0.7928rem + 0.884vw, 1.5rem);

Common mistakes

  • A maximum so large that headings dominate wide screens.
  • Using only vw, which ignores users' font settings.
  • Mixing px and rem inconsistently across the scale.

The formula

slope = (max − min) ÷ (maxViewport − minViewport)
preferred = (min − slope × minViewport) + slope × 100vw

Privacy

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.

Frequently asked questions

Do all browsers support clamp()?

Yes. clamp() has been supported by all major browsers since 2020.

Why use rem for the minimum and maximum?

rem respects the reader's browser font-size setting. Sizes based only on vw ignore that setting and don't grow when people zoom in on some devices, which can fail accessibility requirements.

Can I use clamp for spacing?

Yes, any length works, such as padding, margin and gap.

Which viewport widths should I use?

Commonly about 360–400 px for the minimum and 1200–1440 px for the maximum.

Content last updated . See how M2Toolkit works.

Other tools people use alongside the fluid font size (clamp) generator.