JavaScript squareRoot

Math.sqrt() returns the square root of a number. Passing a negative value returns NaN.

Syntax

Math.sqrt(num)

Examples

Input Arguments Output
9 3

Gotchas

  • Math.sqrt of a negative number is NaN.

Try it live

Type your input and see squareRoot transform it instantly.

Description: Returns the square root of a number.

Example: square root of 16 => 4

Want to go further? Chain squareRoot with other functions in the visual Playground — pipe one output into the next and watch your data transform.

Related functions

© 2026 Heifara Buval