Fluid Typography Scale Calculator - Online clamp() Generator
Define min and max font sizes and viewport widths. Generate a complete fluid type scale using CSS clamp() for all headings.
UD5 Toolkit
Generate CSS clamp() functions for fluid typography — no more breakpoints.
The quick brown fox jumps over the lazy dog
clamp() is a CSS function that clamps a value between an upper and lower bound. It takes three parameters: clamp(MIN, PREFERRED, MAX). The function returns the preferred value if it lies between MIN and MAX; otherwise, it returns MIN (if preferred is too small) or MAX (if preferred is too large). For responsive typography, the preferred value typically uses viewport units (vw), allowing font sizes to scale smoothly with screen width without media queries.
Media queries create discrete breakpoints where font sizes "jump" — this can feel jarring. clamp() enables fluid typography that scales continuously between defined limits, providing a smoother reading experience across all screen sizes. It also reduces CSS code and is easier to maintain than multiple @media rules. A single clamp() declaration can replace 3–5 media query blocks.
The linear interpolation formula used is:preferred = minFont + (maxFont − minFont) × (100vw − minViewport) / (maxViewport − minViewport)
This creates a straight-line relationship between viewport width and font size. The slope is (maxFont − minFont) / (maxViewport − minViewport). Our calculator generates a clean CSS calc() expression that browsers evaluate natively.
clamp() is supported in all modern browsers: Chrome 79+, Firefox 75+, Safari 13.1+, and Edge 79+. It has 97%+ global browser support as of 2024. For older browsers, you can provide a fallback by declaring a fixed font size before the clamp() declaration — browsers that don't understand clamp() will ignore it and use the fallback.
Both work well. rem is generally recommended for accessibility because it respects the user's browser font size preference. If a user has set a larger default font size in their browser settings, rem-based values will scale accordingly. px offers more predictable, pixel-perfect control. Many developers use rem for body text and px for headings or decorative text. With our calculator, you can experiment with both units.
Common breakpoints: 320px (small mobile), 768px (tablet), 1024px (small desktop), 1200–1440px (standard desktop), and 1920px (large desktop). A typical fluid typography setup uses 320px as the minimum viewport and 1200px as the maximum. Font sizes stop scaling beyond these limits — clamped at the min below 320px and at the max above 1200px.
Absolutely! clamp() works with any CSS length property. You can use it for line-height, padding, margin, gap, width, and more. For example: padding: clamp(1rem, 3vw, 3rem); creates responsive spacing that scales with the viewport. Fluid spacing combined with fluid typography creates a beautifully responsive design system.
Use our live preview slider above to simulate different viewport widths. For real device testing, use Chrome DevTools' responsive mode (Ctrl+Shift+M / Cmd+Shift+M), which lets you preview at exact device dimensions. You can also use online services like BrowserStack or simply resize your browser window while watching the text scale smoothly.
Define min and max font sizes and viewport widths. Generate a complete fluid type scale using CSS clamp() for all headings.
Select a ratio (1.25, 1.333, 1.5) and a base size to generate a full typographic scale for h1‑h6. Copy CSS variables.
Write expressions with clamp(), min(), max(), abs(), sign(), round() and see the computed value. Modern CSS calculations.
Design a layout where nested grids share track sizes with their parent via subgrid. Copy the complete CSS.
Create a pure CSS scroll progress indicator using animation‑timeline: scroll(). No JavaScript. Copy the complete code.
Paste your CSS and see warnings for properties that have limited browser support. Links to CanIUse. Modernize safely.
Limit browser gestures on an element: pan‑x, pinch‑zoom, manipulation. Draw on a canvas to test. Mobile dev helper.
Create complex linear gradients with any number of color stops, exact angles, and length units. Live preview and CSS code.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS text‑decoration.
Generate a random HTML/CSS card with different box model properties. Inspect and guess the size. For learners.
Design a button or card that glows on hover. Adjust shadow color, spread, and transition. Copy the CSS. Rich UI.
Type any character and see how it renders in different font stacks. Detect missing glyphs and fallback behavior.
Create a realistic letterpress (debossed) text effect using CSS text‑shadow and background. Adjust depth and light direction. Copy code.
Generate a subtle noise/grain texture as a CSS background pattern. Adjust opacity and size. For that film look.
Create a customizable checkerboard or grid background using pure CSS gradients. Adjust cell size and colors. Copy the code.
Upload two images and apply CSS blend modes (multiply, screen, overlay, etc.). See the result and copy the filter CSS. Pure frontend.
Add print styles like removing backgrounds, adding page breaks, setting margins. See print preview instantly.
Create a pure CSS countdown timer with a flipping number effect. Adjust duration and style. No JavaScript needed for display.
Create a glowing or rotating border animation around an element. Copy the CSS keyframes. Pure CSS magic.
Create a custom HTML/CSS progress bar with percentage, colors, and animation. Copy the code. Modern UI element.
Type a few words and see them rendered at every heading size (h1–h6) with your chosen font. Perfect for design systems.
Design a realistic neon sign text with multiple layers of glow. Copy the CSS and HTML. Perfect for headers.
A replica of the famous Flexbox Froggy game: solve alignment puzzles by writing CSS. Progress saved locally. Fun frontend learning.
Fetch a website's CSS and extract :root custom properties (‑‑color) to reveal its design token palette. For learning and inspiration.
Select a heading font and get recommended body font pairings. Live preview with sample text. Copy the CSS import links.
Recreate the target CSS linear gradient by adjusting stops and colors. A unique game for front‑end developers to master gradients.
Browse and search all Font Awesome 6 icons with preview, class name, and unicode. Copy the HTML snippet. Perfect for web developers.
Create text with a gradient fill using CSS background-clip. Configure colors and direction. Copy the code. Works in modern browsers.
A complete, searchable list of all 140+ named HTML/CSS colors with their hex codes and color previews. Click to copy code. Essential web reference.
Visually experiment with Flexbox container and item properties. See the layout update in real time and copy the CSS. Learn by doing, fully interactive.