Home/Tools/Typography/Fluid Typography
Typography · Generator

Fluid Typography

Generate responsive font sizes that scale smoothly between breakpoints.

Font Size Range

16px
24px

Viewport Range

320px
1200px

Preview

The quick brown fox jumps over the lazy dog

Current size: scales from 16px to 24px

Viewport range: 320px to 1200px

Generated Value

clamp(1rem, 13.0909rem + 0.9091vw, 1.5rem)
Generated CSS
/* Fluid Typography using clamp() */
html {
  font-size: 16px;
}

.element {
  font-size: clamp(1rem, 13.0909rem + 0.9091vw, 1.5rem);
  /* Scales smoothly between breakpoints */
}
100%
Free, no
sign-up needed
0
Code written
by hand
85+
CSS tools
in one place
<1s
Copy-ready
CSS instantly
What is this

What is the Fluid Typography Generator?

Generate CSS clamp() values for type sizes that scale smoothly between a minimum viewport width and a maximum. No breakpoints, no jumps.

Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.

How to use

Using the Fluid Typography Generator

Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.

1

Set minimum and maximum font sizes

Enter the smallest size (for mobile viewports) and the largest size (for desktop viewports) in px or rem.

2

Set viewport range

Enter the viewport widths where the font should be at its minimum and maximum. Typical values: 320px min, 1280px max.

3

Copy the clamp() value

Click Copy to grab the computed clamp() expression. Paste it as the value of font-size, padding, or any property that should scale with viewport.

The output

What the generated code looks like

Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.

styles.css
/* Fluid heading: 24px at 320px viewport, 48px at 1280px */
h1 {
  font-size: clamp(1.5rem, 2.5vw + 1rem, 3rem);
}

/* Fluid body: 16px at 320px, 18px at 1280px */
body {
  font-size: clamp(1rem, 0.25vw + 0.95rem, 1.125rem);
}

/* Fluid spacing that scales with type */
.section {
  padding: clamp(2rem, 5vw, 5rem);
}

The formula: clamp(MIN, PREFERRED, MAX). The preferred value is a viewport-relative expression that crosses from MIN to MAX across your viewport range.

Pro tips

Pro tips for better results

Use rem for font-size, px for viewport widths in the formula

Converting viewport widths to rem in the clamp formula keeps the math consistent and respects user font size preferences.

Test at the minimum viewport, not just desktop

Load your page at 320px width and verify the text is still readable. Fluid type can go too small if the minimum is too low.

Fluid typography removes the need for font-size media queries

A single clamp() value replaces two or three breakpoint-based font-size overrides. Less code, no abrupt size jumps.

Apply fluid sizing to spacing too

clamp(1rem, 3vw, 3rem) works equally well for padding and gap values. It gives you proportional spacing without separate mobile/desktop overrides.

FAQ

Frequently asked questions

clamp(MIN, PREFERRED, MAX) returns the preferred value if it falls between min and max, otherwise it clamps to the min or max. For font sizes, the preferred value is usually a viewport-relative expression that grows as the screen widens.
clamp() is supported in Chrome 79+, Firefox 75+, Safari 13.1+, and Edge 79+ - covering more than 95% of current web traffic.
No. Everything runs in your browser. Nothing is sent to a server.

From the blog

Read more