Fluid Font Size Calculator
Author one fluid font size from two design sizes and viewport widths. Copy root-relative CSS and inspect a model calculated from the same serialized coefficients.
Define the size transition
- Enter smaller and larger viewport widths in CSS pixels, at least 100px apart, and the font size at each width. Sizes may increase, decrease or stay constant. State the assumed CSS pixels per rem.
- Inspect the current declaration and endpoint table. Change the model test width to inspect another point; this changes the model specimen without changing copied CSS or pretending the card is a viewport.
- Copy CSS and test it on a non-root element in the receiving page. Its actual root size, viewport, font and zoom behavior matter. Clipboard denial lets you select the same declaration manually.
Understand the expression
The calculator divides the font-size difference by the viewport-width difference to obtain a slope. It multiplies that slope by 100 for the vw term, then converts the offset and numerical size bounds to rem using your assumed root.
Smaller and larger describe viewport widths, not necessarily font sizes. A decreasing design uses a negative viewport coefficient with numerically ordered clamp bounds. Equal font sizes produce a simpler constant rem declaration.
Coefficients are rounded to six decimals with exact halfway values away from zero. The table and test specimen use those copied coefficients, so they can differ slightly from ideal endpoint interpolation. Displayed pixel samples use three decimals and identify rounding.
The root value is a conversion assumption. A receiving page with another root can change both font bounds and transition widths. rem refers to the document root, and vw to the viewport; changing an ordinary div’s width or font size does not simulate either.
Increasing, decreasing and rounded examples
The default design uses 16px at a 320px viewport and 32px at 1600px, assuming a 16px root. It produces clamp(1rem, calc(0.75rem + 1.25vw), 2rem), with a modeled size of exactly 24px at 960px.
Reversing those endpoint sizes produces clamp(1rem, calc(2.25rem - 1.25vw), 2rem). Both bounds stay numerically ordered. Entering 20px at both widths instead produces font-size: 1.25rem; under the same assumed root.
For 17px at 360px and 23px at 1280px, six-decimal coefficients give 17.0000024px at the first width and 20.0000028px at the midpoint in the copied arithmetic model. The endpoint table rounds those samples; it does not claim exact hits hidden behind formatted values.
Authoring and model limits
Viewport widths are integers from 240 to 3840 CSS pixels, at least 100px apart. Font sizes are 1–256 CSS pixels and assumed root sizes 8–32 CSS pixels per rem, with up to two decimals. Signs, units in fields, grouping, exponents and excess precision are rejected rather than silently corrected.
This authors one non-root font-size declaration with rem and vw. It does not import arbitrary CSS, build a type scale, use container units, upload fonts or alter the application’s root stylesheet. The six-decimal error bound belongs to a finite arithmetic model, not browser rasterization.
The specimen applies a calculated pixel size and wraps within its card. It is not a simulated viewport or proof that copied CSS behaves identically on your page. Actual fonts, roots, viewports and browser precision can change the result.
Mixed rem and viewport units do not automatically prove accessible text resizing. Test the receiving page with browser text and zoom settings. The tool provides no universal WCAG badge, fixed pixel-match promise or guaranteed doubling of the font at 200% zoom.
Local numeric authoring without saved settings
The tool adds no upload, remote font request, saved draft history, settings-bearing link or telemetry containing your values. Copy is explicit. Existing site services, extensions and copies you retain are outside a universal privacy or erasure promise.
Fluid font-size questions
Sources
References for CSS units, interpolation and text resizing.
- CSSWGdrafts.csswg.orgCSS Values and UnitsDefinitions of clamp and relative lengths.
- MDNdeveloper.mozilla.orgMDN CSS referencesUsage and browser behavior of font-size, clamp and length units.
- MDNdeveloper.mozilla.orgMDN CSS referencesUsage and browser behavior of font-size, clamp and length units.
- MDNdeveloper.mozilla.orgMDN CSS referencesUsage and browser behavior of font-size, clamp and length units.
- W3Cw3.orgW3C text resizingGuidance and failure examples for text resizing and viewport units.
- W3Cw3.orgW3C text resizingGuidance and failure examples for text resizing and viewport units.
Reviewed 13 November 2026.
These references do not certify the exported CSS for a receiving page.
Related tools
SVG to PNG
Convert a local SVG file or pasted markup into PNG, with explicit dimensions, transparency and bundled fonts.
Open tool — SVG to PNGCSS Filter Generator
Order and repeat CSS effects, compare a specimen and copy the exact filter declaration.
Open tool — CSS Filter GeneratorCSS Button Generator
Style native button states, inspect keyboard focus and copy HTML and CSS.
Open tool — CSS Button GeneratorCSS Border Radius Generator
Edit eight corner radii, preview a box and copy CSS in pixels or percentages.
Open tool — CSS Border Radius GeneratorCSS Grid Generator
Build a bounded CSS Grid example with editable tracks, placement and named areas. Preview it, copy CSS or HTML and download the same standalone example.
Open tool — CSS Grid GeneratorCSS Flexbox Generator
Build a Flexbox example with container and item controls, explicit layout axes, matching CSS and HTML, and a local complete-example download.
Open tool — CSS Flexbox GeneratorCSS Text Shadow Generator
Build ordered text shadows, preview plain text and copy exact CSS.
Open tool — CSS Text Shadow GeneratorCSS Transform Generator
Compose repeatable 2D CSS transforms, edit px or percentage translation and origin, inspect a reference box and copy the exact current declarations.
Open tool — CSS Transform GeneratorCSS Box Shadow Generator
Create ordered CSS box-shadow layers with a live preview and copyable code.
Open tool — CSS Box Shadow GeneratorImage Watermark
Add a text or logo watermark to a batch of images, review each result and download individual files or a ZIP.
Open tool — Image WatermarkCSS Gradient Generator
Create linear or radial CSS gradients with editable colors, opacity and stops.
Open tool — CSS Gradient GeneratorColor Converter
Convert supported sRGB HEX, RGB and HSL literals with alpha, explicit precision and current code Copy.
Open tool — Color ConverterImage to Text (OCR)
Recognize printed text in local PNG or JPEG images, choose a language and review or correct the result before copying or downloading.
Open tool — Image to Text (OCR)QR Code Reader
Read one QR code from a local PNG or JPEG and inspect its text or content bytes without opening links.
Open tool — QR Code ReaderColor Contrast Checker
Compare foreground and background colors, adjust opacity and check WCAG numerical contrast thresholds for text and essential interface details.
Open tool — Color Contrast CheckerPrint Size & Resolution Calculator
Calculate print dimensions, required pixels and effective PPI with fit or crop.
Open tool — Print Size & Resolution CalculatorAspect Ratio Calculator
Find a width-to-height ratio or calculate a matching pixel size from one target dimension.
Open tool — Aspect Ratio CalculatorImage Compressor
Try to fit a JPEG, PNG or WebP within a target file size, with measured results and optional smaller dimensions.
Open tool — Image CompressorHEIC to JPG
Convert supported HEIC photos locally into full-size JPG copies, with quality and background controls and verified individual or ZIP downloads.
Open tool — HEIC to JPGImage Converter
Convert supported PNG, JPEG and WebP images locally with batch targets, transparency, background and quality controls, then review and download the encoded files.
Open tool — Image ConverterPhoto Collage Maker
Arrange local photos in a grid, adjust crops and spacing, and download PNG or JPEG.
Open tool — Photo Collage MakerRotate & Flip Images
Rotate or mirror a local batch of static PNG, JPEG and WebP images, then review and download the processed results.
Open tool — Rotate & Flip ImagesImage Cropper
Crop one local JPEG, PNG or WebP to exact pixels with visual and numeric controls. Download PNG or JPEG.
Open tool — Image CropperImage Resizer
Resize a JPG, PNG or WebP image by pixels or percentage, preview the result and download it.
Open tool — Image Resizer