JavaScript absolute

Math.abs() returns the absolute value of a number. Its distance from zero, always non-negative.

Syntax

Math.abs(num)

Examples

Input Arguments Output
-5 5

Try it live

Type your input and see absolute transform it instantly.

absolute()

Type above to see the result…

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

Related functions

© 2026 Heifara Buval