Font Scale Calculator
Generate harmonious typographic font scales using mathematical ratios for consistent web typography.
Scale Settings
Type Scale Preview
The quick brown fox
10.2px
0.640rem
The quick brown fox
12.8px
0.800rem
The quick brown fox
16.0px
1.000rem
The quick brown fox
20.0px
1.250rem
The quick brown fox
25.0px
1.563rem
The quick brown fox
31.3px
1.953rem
The quick brown fox
39.1px
2.441rem
The quick brown fox
48.8px
3.052rem
The quick brown fox
61.0px
3.815rem
CSS Variables
:root {
--font-size-0: 0.6400rem;
--font-size-1: 0.8000rem;
--font-size-2: 1.0000rem;
--font-size-3: 1.2500rem;
--font-size-4: 1.5625rem;
--font-size-5: 1.9531rem;
--font-size-6: 2.4414rem;
--font-size-7: 3.0518rem;
--font-size-8: 3.8147rem;
}Scale Summary
Base
16px
Ratio
1.25
Steps
9
What Is a Font Scale Calculator?
A font scale calculator is a tool that generates a mathematically consistent set of font sizes for use in web design, UI design, and typography systems. Instead of picking font sizes arbitrarily, a type scale applies a single ratio to a base font size, multiplying or dividing repeatedly to produce every heading, body, caption, and label size in your design.
The result is a modular scale โ a sequence of sizes that are harmonically related to one another the same way musical notes in a scale are related. When your typography follows a modular scale, the visual rhythm feels natural and intentional, whether viewed on a small mobile screen or a wide desktop monitor.
This calculator lets you set a base font size (commonly 16px, the browser default), choose a scale ratio (such as the Major Third at 1.25 or Perfect Fourth at 1.333), specify how many larger and smaller steps you need, and instantly see every size along with its px, rem, and em equivalents. It also outputs ready-to-paste CSS custom properties so you can drop the scale straight into your stylesheet.
Whether you are building a design system from scratch, fine-tuning a brand's typography hierarchy, or just trying to make your headings feel proportionate to your body text, a font scale calculator removes the guesswork and replaces it with mathematical precision.
How the Font Scale Is Calculated
The font scale calculator uses exponential scaling based on a chosen ratio. Every step in the scale is derived from the base font size by raising the ratio to the power of that step number.
For steps above the base (larger sizes), the formula multiplies the base size by the ratio raised to the step index. For steps below the base (smaller sizes), the formula divides the base size by the ratio raised to the absolute step index. This produces a smooth, geometric progression in both directions from the base.
Once a pixel value is computed, rem and em equivalents are derived by simple division. The rem value divides the pixel size by 16 (the standard browser root font size). The em value divides the pixel size by the chosen base font size.
Font Scale Formula
Where:
- size(i)= Computed font size at step i (in px)
- baseSize= The root font size in pixels (e.g., 16px)
- ratio= The scale ratio multiplier (e.g., 1.25 for Major Third)
- i= Step index โ positive for larger sizes, negative for smaller
- rem= size รท 16 โ relative to root element font size
- em= size รท baseSize โ relative to parent element font size
Common Typographic Scale Ratios Explained
The ratio you choose has a dramatic effect on the visual contrast between steps. A small ratio like Minor Second (1.067) produces sizes that are very close together โ suitable for dense data interfaces where hierarchy is subtle. A large ratio like the Golden Ratio (1.618) creates bold contrasts that work well for editorial or marketing pages with strong heading differentiation.
Here are the standard named ratios supported by this font scale calculator:
| Name | Ratio | Best Use |
|---|---|---|
| Minor Second | 1.067 | Dense UIs, data-heavy dashboards |
| Major Second | 1.125 | Compact apps, small screens |
| Minor Third | 1.2 | General web content |
| Major Third | 1.25 | Blogs, landing pages |
| Perfect Fourth | 1.333 | Strong visual hierarchy, magazines |
| Augmented Fourth | 1.414 | Bold editorial layouts |
| Perfect Fifth | 1.5 | Display typography, hero sections |
| Golden Ratio | 1.618 | Maximum contrast, dramatic headings |
Musical interval names were adopted in typography because the same mathematical ratios that describe consonant intervals in Western music also create visually pleasing proportions. This connection between music theory and type design has been championed by designers and typographers since the early days of responsive web design.
Choosing Between px, rem, and em Units
Once your type scale is computed, you can output the sizes in three CSS units: px, rem, and em. Each has different implications for accessibility and responsive design, and understanding the difference will help you pick the right one for your project.
Pixels (px) are absolute units. A font size of 20px is always 20px regardless of user preferences. While px values are predictable, they do not scale when users change their browser's default font size โ which can create accessibility problems for users who rely on larger text.
rem (root em) units are relative to the root element's font size โ by default, 16px in most browsers. Using rem for font sizes means your scale respects the user's browser preference. If a user sets their browser default to 20px, all rem-based sizes scale proportionally. This is the recommended unit for most modern web projects and design systems.
em units are relative to the font size of the parent element. They can compound unpredictably in nested structures, so they are less common for global font scales. They are more useful for component-scoped sizing where you want sizes to remain proportional to whatever context the component is placed in.
For most design systems and styleguide implementations, rem is the best choice. The CSS variables output by this calculator uses the unit you select, so you can experiment with all three directly from the results panel.
Using the Generated CSS Variables in Your Project
The font scale calculator outputs a block of CSS custom properties (also called CSS variables) that you can paste directly into your stylesheet. These variables follow the pattern --font-size-0, --font-size-1, and so on, indexed sequentially from the smallest step to the largest.
To use them, paste the :root { ... } block at the top of your CSS file or inside a global stylesheet in your framework. Then reference them anywhere in your styles using the var() function. For example:
font-size: var(--font-size-3);for a subheadingfont-size: var(--font-size-5);for a page titlefont-size: var(--font-size-1);for a caption or helper text
This approach creates a single source of truth for all font sizes in your project. If you later decide to change the scale ratio from 1.25 to 1.333, you update just one place โ the CSS variable definitions โ and every component that references those variables updates automatically.
In Tailwind CSS projects, you can extend the fontSize theme key with these values. In styled-components or Emotion projects, export the scale as a JavaScript theme object. Design token tools like Style Dictionary can also consume these values as part of a broader token pipeline.
Having a consistent type scale in CSS variables is an important part of building an accessible, maintainable, and visually coherent design system โ whether you are working solo or on a large cross-functional team.
Typography Best Practices for Web Design
A mathematically sound font scale is only one part of good web typography. Here are several additional considerations that work hand-in-hand with a well-chosen type scale to produce professional, readable results.
Line height and reading comfort: Larger font sizes typically need tighter line heights (1.1 to 1.3) while body text benefits from more generous line heights (1.5 to 1.7). Using a modular scale for font sizes while keeping line heights proportionally adjusted ensures a consistent vertical rhythm throughout the page.
Limit the number of visible sizes: Even if your scale has 10 steps, most pages should use only 4 to 6 of them consistently. Overusing every level of the hierarchy creates visual noise rather than clarity.
Pair the scale with a strong font choice: A good type scale amplifies a good typeface. Geometric sans-serifs like Inter or Geist tend to look clean at small sizes, while display serifs come alive at large heading sizes. Consider using the font pairing tool alongside this calculator.
Mobile-first scaling: On smaller viewports, a large ratio creates headings that are too large to fit comfortably. Many designers use a smaller ratio (e.g., Minor Third at 1.2) for mobile breakpoints and a larger ratio (e.g., Perfect Fourth at 1.333) for desktop. CSS clamp() can smooth these transitions fluidly without JavaScript.
Accessibility: Ensure sufficient contrast between font color and background at every size. Also avoid setting body text below 14px (0.875rem) โ many users, especially older readers, find small text difficult to read even at high screen resolutions.
Worked Examples
Major Third Scale โ 16px Base
Problem:
Calculate the font sizes for steps -1, 0, 1, 2, and 3 using a base of 16px and a Major Third ratio of 1.25.
Solution Steps:
- 1Step -1 (smaller): 16 รท 1.25^1 = 16 รท 1.25 = 12.8px โ 0.8rem
- 2Step 0 (base): 16 ร 1.25^0 = 16 ร 1 = 16px โ 1.0rem
- 3Step 1: 16 ร 1.25^1 = 16 ร 1.25 = 20px โ 1.25rem
- 4Step 2: 16 ร 1.25^2 = 16 ร 1.5625 = 25px โ 1.5625rem
- 5Step 3: 16 ร 1.25^3 = 16 ร 1.953125 = 31.25px โ 1.953rem
Result:
A 5-step scale spanning 12.8px to 31.25px โ suitable for body text, subheadings, and page titles on a blog or landing page.
Perfect Fourth Scale โ 18px Base
Problem:
A designer uses an 18px base with a Perfect Fourth ratio (1.333). What are steps 0, 1, 2, and 3?
Solution Steps:
- 1Step 0 (base): 18 ร 1.333^0 = 18 ร 1 = 18px โ 1.125rem
- 2Step 1: 18 ร 1.333^1 = 18 ร 1.333 = 23.99px โ 24px โ 1.5rem
- 3Step 2: 18 ร 1.333^2 = 18 ร 1.777 = 31.99px โ 32px โ 2.0rem
- 4Step 3: 18 ร 1.333^3 = 18 ร 2.370 = 42.66px โ 2.666rem
Result:
A scale with strong visual contrast between steps โ ideal for magazine-style layouts where headings need to be visually dominant.
Golden Ratio Scale โ 16px Base
Problem:
Using the Golden Ratio (1.618) and a 16px base, compute steps -1, 0, 1, and 2.
Solution Steps:
- 1Step -1: 16 รท 1.618^1 = 16 รท 1.618 = 9.89px โ 0.618rem
- 2Step 0 (base): 16 ร 1.618^0 = 16px โ 1.0rem
- 3Step 1: 16 ร 1.618^1 = 16 ร 1.618 = 25.89px โ 1.618rem
- 4Step 2: 16 ร 1.618^2 = 16 ร 2.618 = 41.89px โ 2.618rem
Result:
The Golden Ratio creates dramatic jumps between steps. The jump from 16px to ~42px in just two steps makes this ratio best for hero and display typography rather than dense content pages.
Minor Third Scale โ Mobile-Friendly 14px Base
Problem:
A mobile-first project uses 14px base with a Minor Third ratio (1.2). Find steps 0, 1, 2, 3.
Solution Steps:
- 1Step 0 (base): 14 ร 1.2^0 = 14px โ 0.875rem
- 2Step 1: 14 ร 1.2^1 = 14 ร 1.2 = 16.8px โ 1.05rem
- 3Step 2: 14 ร 1.2^2 = 14 ร 1.44 = 20.16px โ 1.26rem
- 4Step 3: 14 ร 1.2^3 = 14 ร 1.728 = 24.19px โ 1.512rem
Result:
A compact scale where no size jumps feel jarring โ perfectly suited for mobile viewports, sidebars, or data-dense interfaces where space is at a premium.
Tips & Best Practices
- โStart with 16px base and the Major Third (1.25) ratio โ this is the most versatile combination for general web projects.
- โName your scale steps semantically (caption, body, h4, h3, h2, h1, display) rather than by index number so designers and developers use them consistently.
- โOn mobile viewports, switch to a smaller ratio like Minor Third (1.2) using a media query to prevent headings from overwhelming the layout.
- โUse rem output and paste the :root { } block into your global stylesheet as the single source of truth for all text sizes.
- โLimit yourself to 4 to 6 visible type sizes per page โ even if the scale has 10 steps, using all of them creates visual noise rather than hierarchy.
- โCombine your type scale with consistent line heights: use 1.1โ1.3 for large display text and 1.5โ1.7 for body copy to maintain vertical rhythm.
- โThe Perfect Fourth (1.333) ratio is widely used in professional design systems because it creates clear hierarchy without headings becoming too large at just 3 or 4 steps.
- โWhen building a design system, export the scale as both CSS variables and a JavaScript object so both CSS-in-JS and vanilla CSS consumers can use the same values.
Frequently Asked Questions
Sources & References
Last updated: 2026-06-05
Help us improve!
How would you rate the Font Scale Calculator?
Editorial Note
MyCalcBuddy Editorial Team
This page is maintained as an educational calculator reference.
Formula Source: Standard Mathematical References
by Various