=TANH(value)One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
| Parameter | Required | Description |
|---|---|---|
| value | Yes | Any real number to calculate the hyperbolic tangent of. Unlike TAN, this is not an angle. |
TANH returns the hyperbolic tangent of a number. It is defined as
TANH(x) = SINH(x) / COSH(x) = (e^x − e^−x) / (e^x + e^−x)
Despite the similar name, TANH is not a trigonometric function of an angle — it belongs to the hyperbolic family (SINH, COSH, TANH), which is built from the exponential function. There is no need to convert to radians.
TANH(0) is 0.TANH(-x) = -TANH(x).This S-shaped curve is what makes TANH useful — it squashes any input into a bounded range while preserving the sign and ordering.
=TANH(1)Returns approximately 0.7616.
=TANH(5)Returns approximately 0.9999.
=TANH(-0.5)Returns approximately −0.4621.
=ARRAYFORMULA(TANH(B2:B100))If you have unbounded scores (for example, net sentiment or z-scores) and want them between −1 and 1 without hard clipping, TANH gives a smooth result:
=TANH(B2 / 10)Dividing by a scale factor controls how quickly values saturate.
TANH is a classic activation function. If you are prototyping a tiny model or teaching how one works in a spreadsheet, you can compute a neuron's output with:
=TANH(SUMPRODUCT(B2:D2, $B$10:$D$10) + $E$10)To reverse the operation, use ATANH, which accepts values strictly between −1 and 1:
=ATANH(TANH(0.8))returns 0.8. ATANH is also the Fisher transformation used to normalise correlation coefficients: =ATANH(CORREL(A2:A50, B2:B50)).
The logistic (sigmoid) function is closely related: (TANH(x/2) + 1) / 2 equals 1 / (1 + EXP(-x)).
=TANH(z) returns a correlation).SINH, COSH, ATANH, TAN, EXP, FISHER, and FISHERINV.
A data analyst averaging correlation coefficients across several studies converts each r to a Fisher z with =ATANH(B2), averages the z values, and converts the average back to a correlation with =TANH(D1) — a statistically sounder approach than averaging r directly.
Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.
Browse our complete library of Google Sheets formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.