About Responsive Font Size Calculator
Set the font size you want on a phone and on a wide desktop screen, and this calculator gives you one font-size declaration that moves smoothly between the two. Below the narrow width the text stays at its small size; above the wide width it stops growing.
The sample sentence is drawn at the exact size it would have at your narrow width, halfway, and your wide width, and a table lists the size at common device widths. If the text would grow so much that browser zoom can no longer double it, you are warned.
How it works
- The slope is the change in size divided by the change in viewport width. One hundredth of the viewport width is 1vw, so the slope times 100 is the vw part of the preferred value.
- The constant part is the size the line would give at a zero-width viewport. It is written in rem (or px), and as a subtraction when it is negative.
- The smaller of the two sizes becomes the first argument of clamp() and the larger the last, so the value also works when it shrinks as the screen widens.
- Numbers are rounded to four decimal places, which is far below one pixel at any realistic width.
Questions
What sizes should I start from?
Body text is usually 16px to 18px on phones and 18px to 20px on large screens. Headings can grow more: a level one heading might go from 28px to 48px. Keep the growth modest for long text, which is read at every width.
Will this text still respect the reader’s font settings?
Partly. The rem parts of the value follow the reader’s default font size and browser zoom; the vw part follows only the window width. That is why the calculator warns when the large size is more than 2.5 times the small one.
Can I use the same value for line-height?
Yes, but a unitless line-height such as 1.5 already scales with the font size, which is usually what you want. Switch the property to line-height only when you need it in absolute units.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.