CSS clamp() Fluid Size Generator
Make font sizes and spacing that scale smoothly between a small and a large screen, as one clamp() line.
Also called: fluid typography calculator, clamp() calculator.
CSS clamp() Fluid Size Generator
Make font sizes and spacing that scale smoothly between a small and a large screen, as one clamp() line.
Watch: how to use the CSS clamp() Fluid Size Generator (11 seconds)
Recorded on a phone, steps written on screen, no sound.
About the CSS clamp() Fluid Size Generator
Make a font size or spacing that grows smoothly from a smallest size to a largest size between two screen widths, as one CSS clamp() line in rem.
Example: 16 px at 360 px wide up to 24 px at 1280 px wide.
How to use the CSS clamp() Fluid Size Generator
- Add your inputFill in smallest size, largest size, at screen width from and up to screen width. An example is already filled in, so you can press Run tool first to see how it works.
- Press Run toolThe result appears right under the button.
- Copy or download the resultCopy text results with Copy output; when the tool makes a picture or file, use its Download button.
This tool works inside your browser: what you enter stays on your device.
Example
A sample input and the result the CSS clamp() Fluid Size Generator gives for it (produced by the tool itself, not typed by hand).
- Smallest size
- 16
- Largest size
- 24
- At screen width from
- 360
- Up to screen width
- 1280
- Root font size
- 16
Result:
font-size: clamp(1rem, 0.8043rem + 0.8696vw, 1.5rem); Behaviour: 16px at 360px wide, growing smoothly to 24px at 1280px wide, then it stops.
Good to know
- What you need
- You type or choose: Smallest size, Largest size, At screen width from, Up to screen width, Root font size
- Where it runs
- In your browser, on your device.
- Cost
- Free, no sign-up.
Questions
Why rem?
Rem follows the visitor's font-size setting, which helps accessibility.
Which browsers support clamp()?
All current browsers.
More tools in Design
- CSS Gradient Generator
- Image Colour Palette Extractor
- Lorem Ipsum Generator
- PX ⇄ REM Converter
- Screen Colour Picker (eyedropper)
- Screenshot Mockup (browser or phone frame)
- SVG Minifier
- App Icon & Favicon Generator (ZIP)
- Aspect Ratio Calculator
- Chart Maker (bar, line, pie)
- Colour Contrast Checker
- Colour Converter