Skip to main content

Tailwind Fluid Typography Generator

Generate responsive font sizes that scale smoothly between viewports.
No breakpoints needed - just fluid clamp() values.

Preview at 768px viewport
xsThe quick brown fox12.0px
smThe quick brown fox14.0px
baseThe quick brown fox16.0px
lgThe quick brown fox18.9px
xlThe quick brown fox21.9px
2xlThe quick brown fox26.8px
3xlThe quick brown fox32.8px
4xlThe quick brown fox41.6px
5xlThe quick brown fox55.5px
6xlThe quick brown fox69.3px
320px1280px

Balanced scaling for most websites

ClassMin SizeMax SizeGenerated Value
text-xs0.75rem
text-sm0.875rem
text-base1rem
text-lgclamp(1.125rem, 1.0833rem + 0.2083vw, 1.25rem)
text-xlclamp(1.25rem, 1.1667rem + 0.4167vw, 1.5rem)
text-2xlclamp(1.5rem, 1.375rem + 0.625vw, 1.875rem)
text-3xlclamp(1.875rem, 1.75rem + 0.625vw, 2.25rem)
text-4xlclamp(2.25rem, 2rem + 1.25vw, 3rem)
text-5xlclamp(3rem, 2.6667rem + 1.6667vw, 4rem)
text-6xlclamp(3.75rem, 3.3333rem + 2.0833vw, 5rem)
// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      fontSize: {
              'xs': '0.75rem',
              'sm': '0.875rem',
              'base': '1rem',
              'lg': 'clamp(1.125rem, 1.0833rem + 0.2083vw, 1.25rem)',
              'xl': 'clamp(1.25rem, 1.1667rem + 0.4167vw, 1.5rem)',
              '2xl': 'clamp(1.5rem, 1.375rem + 0.625vw, 1.875rem)',
              '3xl': 'clamp(1.875rem, 1.75rem + 0.625vw, 2.25rem)',
              '4xl': 'clamp(2.25rem, 2rem + 1.25vw, 3rem)',
              '5xl': 'clamp(3rem, 2.6667rem + 1.6667vw, 4rem)',
              '6xl': 'clamp(3.75rem, 3.3333rem + 2.0833vw, 5rem)'
      }
    }
  }
}

How Fluid Typography Works

Fluid typography uses CSS clamp() to create font sizes that scale smoothly between a minimum and maximum value based on viewport width.

Minimum

The smallest the font will be, at your minimum viewport (typically mobile).

Preferred

A calculated value using viewport units that scales between min and max.

Maximum

The largest the font will be, at your maximum viewport (typically desktop).

Why Fluid Typography?

No Breakpoint Jumps

Text scales smoothly instead of jumping at breakpoints.

Less CSS

One value handles all screen sizes instead of multiple media queries.

Better Reading Experience

Text is always appropriately sized for the viewport.

Works with Tailwind

Override default sizes or add custom utilities seamlessly.

Usage in Your Project

1. Copy the config

Copy the generated config and paste it into your tailwind.config.js.

2. Use the classes

<h1 class="text-4xl">Fluid heading</h1>
<p class="text-base">Fluid body text</p>
<small class="text-sm">Fluid small text</small>

3. That's it!

No need for responsive prefixes like md:text-lg. The fluid values handle all viewport sizes automatically.