Your input stays in this browser.
Your result will appear here.
Enable JavaScript in your browser to use this tool.
Code examples Starting points for your own code. Run them in the environment shown below.
Copy codeLanguage · exampleJavaScript · Calculate fluid sizing CSS · Responsive font size Use current inputs
Node.js 22+ · ES module (.mjs)
Current inputs apply only to fields used by the example. Selected files are not embedded.
const minSize = 16, maxSize = 32;
const minWidth = 320, maxWidth = 1280;
if (maxWidth <= minWidth || maxSize < minSize) throw new Error("Invalid range");
const slope = (maxSize - minSize) / (maxWidth - minWidth);
const intercept = minSize - slope * minWidth;
console.log("clamp(" + minSize + "px, " + intercept.toFixed(4) + "px + " +
(slope * 100).toFixed(4) + "vw, " + maxSize + "px)");
Put it to work Calculate fluid CSS sizes for a viewport range.
Details that matter Format and meaning Linearly interpolates between viewport endpoints. Check text zoom in your target environment.
Supported scope and limits Text 1 MB
Split inputs that exceed the limit. If a format or algorithm is unsupported, choose a tool that matches your requirements instead of silently changing the format.