pow() CSS Function
The pow() function raises a number to a power, such as pow(2, 3), which is 8. It is useful for typographic scales.
Description
The pow() CSS function raises a base number to the power of an exponent. For example, pow(2, 3) is 8, because 2 × 2 × 2 = 8. Both arguments must be plain <number> values, and the result is a number, so multiply it by a unit when you need a length, time or other dimension.
The most popular use of pow() is building a modular type scale, where each heading level is a fixed ratio larger than the one below it. Instead of hard-coding every size, you can store the ratio in a custom property and raise it to the level number. Fractional and negative exponents also work, so pow(4, 0.5) is 2 and pow(2, -1) is 0.5.
:root {
--ratio: 1.25;
}
h3 { font-size: calc(1rem * pow(var(--ratio), 1)); } /* 1.25rem */
h2 { font-size: calc(1rem * pow(var(--ratio), 2)); } /* about 1.56rem */
h1 { font-size: calc(1rem * pow(var(--ratio), 3)); } /* about 1.95rem */
small { font-size: calc(1rem * pow(var(--ratio), -1)); } /* 0.8rem */
pow() is part of the exponential function family with sqrt(), hypot(), log() and exp().
Interactive Demo
Syntax
pow() = pow( <calc-sum>, <calc-sum> )
Values
- baseA calculation resolving to a <number>: the value to be multiplied by itself.
- exponentA calculation resolving to a <number>: the power to raise the base to. Fractional and negative values are allowed.
Example
Browser Support
The following information will show you the current browser support for the CSS pow() function. Hover over a browser icon to see the version that first introduced support for this CSS function.
Desktop





Tablets & Mobile





