Math.cbrt()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
TheMath.cbrt() static method returns the cube root of a number. That is
In this article
Try it
console.log(Math.cbrt(-1));// Expected output: -1console.log(Math.cbrt(1));// Expected output: 1console.log(Math.cbrt(Infinity));// Expected output: Infinityconsole.log(Math.cbrt(64));// Expected output: 4Syntax
js
Math.cbrt(x)Parameters
xA number.
Return value
The cube root ofx.
Description
Becausecbrt() is a static method ofMath, you always use it asMath.cbrt(), rather than as a method of aMath object you created (Math is not a constructor).
Examples
>Using Math.cbrt()
js
Math.cbrt(-Infinity); // -InfinityMath.cbrt(-1); // -1Math.cbrt(-0); // -0Math.cbrt(0); // 0Math.cbrt(1); // 1Math.cbrt(2); // 1.2599210498948732Math.cbrt(Infinity); // InfinitySpecifications
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-math.cbrt> |