Favorites

JavaScript Math.pow() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Math.pow()
JavaScript Math Static methodThis method is supported by all modern browsers.
Updated 28th November 2026

The Math.pow() static method returns a base number raised to a power. The ** operator does the same thing.

Description

The Math.pow() static method returns the base raised to the exponent. The exponentiation operator ** is equivalent and usually shorter: Math.pow(2, 10) is the same as 2 ** 10. Fractional exponents give roots, and negative exponents give reciprocals.

Some combinations return NaN, such as a negative base with a fractional exponent, because the result isn't a real number. Any number raised to the power 0 is 1, including NaN ** 0.

Unlike the ** operator, Math.pow() doesn't work with BigInts, so use ** for those. It's still useful when you need a function reference, for example to pass to reduce() or map(). Arguments are converted to numbers first, so numeric strings work, while values that can't be converted give NaN.

Syntax

Math.pow(base, exponent)

Parameters

  • baseThe base number.
  • exponentThe power to raise it to.

Return Value

base raised to the power exponent.

Example

console.log(Math.pow(2, 10));
console.log(2 ** 10);
console.log(Math.pow(9, 0.5));
console.log(Math.pow(2, -1));

Browser Support

The following information will show you the current browser support for the Math.pow() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee