Function Updated 16 May 2026
Math.sqrt(value)
Calculates and returns the square root of a number.
Parameters
valuenumberrequiredNumber to calculate square root of.
Returns
A number, the square root of specified value.
Example
Normal JavaScript, running in the browser or on the Docly™ server.
write(Math.sqrt(64));
write("\n");
/* Expected output: 8 */
write(Math.sqrt(256));
write("\n");
/* Expected output: 16 */
write(Math.sqrt(1000));
/* Expected output: 31.622776601683793 */
The JavaScript above produces this output:
8
16
31.622776601683793