CSS clamp() Generator
Generate a CSS clamp() value for fluid font sizes and spacing between two screen widths, with a live preview and px or rem output. Free and private.
More options
CSS
Preview
At 800px wide the size is 19.83px (1.239rem).
Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)
Next steps
Done here? Use the Send to… menu on the result to carry it on to px to rem Converter.
Free Online CSS clamp() Generator for Fluid Typography
Make text and spacing that scale smoothly from a small size on phones to a large size on desktops. Choose the two sizes and the two screen widths, and copy the clamp() value. It gives developers a quick browser-based way to solve a focused css clamp() generator task before moving the result into a project.
How to make a fluid size
Set the smallest and largest size and the screen widths where each applies. The clamp() value and a live preview update at once. Copy the result into your CSS, for example font-size: clamp(…).
Testing the result
Move the screen width slider under the preview to see the size at that width.
Common mistakes
- Setting the minimum width larger than the maximum width: the formula then makes no sense and the tool asks you to swap them.
- Using only vw units: text stops responding to the reader's zoom. The rem part keeps it accessible.