Math.atanh()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
TheMath.atanh() static method returns the inverse hyperbolic tangent of a number. That is,
In this article
Try it
console.log(Math.atanh(-1));// Expected output: -Infinityconsole.log(Math.atanh(0));// Expected output: 0console.log(Math.atanh(0.5));// Expected output: 0.549306144334055 (approximately)console.log(Math.atanh(1));// Expected output: InfinitySyntax
js
Math.atanh(x)Parameters
xA number between -1 and 1, inclusive.
Return value
The inverse hyperbolic tangent ofx. Ifx is 1, returnsInfinity. Ifx is -1, returns-Infinity. Ifx is less than -1 or greater than 1, returnsNaN.
Description
Becauseatanh() is a static method ofMath, you always use it asMath.atanh(), rather than as a method of aMath object you created (Math is not a constructor).
Examples
>Using Math.atanh()
js
Math.atanh(-2); // NaNMath.atanh(-1); // -InfinityMath.atanh(-0); // -0Math.atanh(0); // 0Math.atanh(0.5); // 0.5493061443340548Math.atanh(1); // InfinityMath.atanh(2); // NaNSpecifications
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-math.atanh> |