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.

squareRoot()

Type above to see the result…

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

Related functions

© 2026 Heifara Buval