Favorites

JavaScript Math.cbrt() Method

☕
Enjoying this site?

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

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

The Math.cbrt() static method returns the cube root of a number.

Description

The Math.cbrt() static method returns the cube root of a number. Unlike x ** (1/3), it handles negative numbers correctly.

Cube roots appear in volume calculations, such as finding the side length of a cube from its volume, and in some colour-space conversions. Results can show tiny floating point errors for numbers that aren't perfect cubes.

It returns NaN for values that can't be converted to numbers, and keeps the sign of zero and infinity. Like every member of Math, it's called on the Math object itself rather than on a number, and it only works with the Number type: passing a BigInt throws a TypeError.

Syntax

Math.cbrt(x)

Parameters

  • xA number.

Return Value

The cube root of x.

Example

console.log(Math.cbrt(27));
console.log(Math.cbrt(-8));
console.log((-8) ** (1 / 3));

Browser Support

The following information will show you the current browser support for the Math.cbrt() 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