Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The Math.pow() static method returns the value of a base raised to a power. That is
𝙼𝚊𝚝𝚑.𝚙𝚘𝚠(𝚡,𝚢)=xy\mathtt{\operatorname{Math.pow}(x, y)} = x^yThe base number.
exponentThe exponent number.
A number representing base taken to the power of exponent. Returns NaN in one of the following cases:
Math.pow() is equivalent to the ** operator, except Math.pow() only accepts numbers.
Math.pow(NaN, 0) (and the equivalent NaN ** 0) is the only case where NaN doesn't propagate through mathematical operations — it returns 1 despite the operand being NaN. In addition, the behavior where base is 1 and exponent is non-finite (±Infinity or NaN) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns NaN to preserve backward compatibility with its original behavior.
Because pow() is a static method of Math, use it as Math.pow(), rather than as a method of a Math object you created (Math is not a constructor).
| ECMAScript® 2027 Language Specification # sec-math.pow |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 10, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.