JavaScript (ES2026) reference · Math Methods and Constants

JavaScript Math.pow() Method

Return a base raised to an exponent. The ** operator does the same: Math.pow(2, 10) equals 2 ** 10.

JavaScript (ES2026) Since ES1

Create a free account to save this page, take notes and track your progress. Sign in

Syntax

Math.pow(base, exponent)

Parameters

ParameterDescription
base The base.
exponent The power.

Return value

A number.

Examples

Powers and rootsTry it yourself
console.log(Math.pow(2, 10), 2 ** 10, Math.pow(9, 0.5));

Output

1024 1024 3
Compound interestTry it yourself
const principal = 1000, rate = 0.05, years = 10;
console.log((principal * Math.pow(1 + rate, years)).toFixed(2));

Output

1628.89

Version history

VersionChange
JavaScript ES1Added

In other languages

Was this page helpful?