The Clamp Calculator 🧮

Calculate a Fluid Typography Scale

Credits 👏

This calculator is inspired by Christopher Kirk-Nielsen's post, "Modern Fluid Typography with Clamp()"


How to Use This Calculator

  • Enter min and max font sizes in px or rem. Your base font will always remain within these limits
  • Enter your min and max viewport widths in px or rem.
  • In between these viewport limits, font size will scale in proportion to the client's viewport width
  • The Result panel shows the generated formula that you can copy into your CSS

Confused about fluid typography? Read my post, "Fluid Typography" which explains how this calculator works in detail


CSS clamp property with fallback


Another fallback strategy that more closely replicates clamp's functionality is available.

Simulated Viewport

Visualize the Scale 👁️‍🗨️

See Your Scale

Use the slider below to simulate the increase and decrease of the viewport's size. Font size will scale according to the values chosen above.

Viewport Control

Base Font Size

Viewport Width


Franz Kafka

One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment. His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he looked.

"What's happened to me?" he thought. It wasn't a dream. His room, a proper human room although a little too small, lay peacefully between its four familiar walls. A collection of textile samples lay spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded frame. It showed a lady fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole of her lower arm towards the viewer.

Gregor then turned to look out the window at the dull weather. Drops of rain could be heard hitting the pane, which made him feel quite sad. "How about if I sleep a little bit longer and forget all this nonsense", he thought, but that was something he was unable to do because he was used to sleeping on his right, and in his present state couldn't get into that position. However hard he threw himself onto his right, he always rolled back to where he was. He must have tried it a hundred times, shut his eyes so that he wouldn't have to look at the floundering legs, and only stopped when he began to feel a mild, dull pain there that he had never felt before.

Continue Reading 🪲