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.
Apply userâselect: none, text, all and see how it affects selection. Copy the CSS snippet for your UI elements.
Test overscrollâbehavior: contain to prevent background scroll or pullâtoârefresh. See the effect in a live demo.
Style a drop cap using the initialâletter property. Set size and sink. Modern alternative to pseudoâelement hacks.
Style a drop cap using the initialâletter property. Set size and sink. Modern alternative to pseudoâelement hacks.
Paste long text and split it into 2, 3, or 4 balanced CSS columns. Preview and copy HTML/CSS. For magazine layouts.
Explore the new twoâvalue display syntax like `display: block flex`. See what each inner/outer pair does visually.
Calculate how many books, DVDs, or vinyl records fit on a shelf given its length and depth. Useful for home library planning. Local only.
Beautify and format your CSS stylesheets instantly. Organize, minify, or prettify CSS code for better readability. Processed securely on client-side.
Calculate resistor values for transistor fixed bias or voltage divider configuration. Quick quiescent point analysis.
Toggle OpenType features like liga, smcp, tnum, and see the text update. Support for variable fonts. Typography nerds.
Calculate tips and split bills easily. Adjust tip percentage and number of people. Perfect for dining out. All computations happen on your device.
Enter your clay's shrinkage rate and the desired fired size to determine the wet dimensions you need to throw or slab build. Essential for functional ware.
Enter frame size and image size to calculate mat borders. Visual preview. Precise framing.
Select your racquet head size, string type, and play style to get a recommended tension range. Find your sweet spot.
A visual guide to common copyâediting and proofreading symbols. Click a mark to see its meaning. For writers.
Design a fully styled scrollbar with colors, width, and border radius. Get the CSS for Chrome and Firefox.
Add N business days to a date, skipping weekends and optionally entering custom holidays. Regional presets.
Make your JavaScript code more readable with this online beautifier. Format and indent JS automatically. Works entirely in your browser, protecting your code privacy.
Design a pure CSS tooltip with custom text, position (top/bottom/left/right), and arrow. Copy the clean code.
Enter two Unix timestamps and get the exact difference in days, hours, minutes, and seconds. Quick time debugging.
Find out what day number of the year any date is (1â366). Also shows days remaining. Simple reference.
Compute Poisson probabilities for a given mean rate. Ideal for call centers, traffic analysis. Instant chart.
Set a short timer with a themed emoji animation (e.g., pizza cooking). A playful visual countdown.
Type JavaScript expressions and see output like a real browser console. Supports console.log, error, warn. Use for quick testing without DevTools.
Enter any date and instantly know which quarter it belongs to. Also shows fiscal quarter if start month set.
Animate elements as they enter and exit the viewport using view() timeline. Parallax and reveal effects without JS.
Emojis are scrambled; you must reorder them to form the correct phrase or title. Fun word play.