TANH Function
Returns the hyperbolic tangent of a number.
Category
Math & Trig
Available in
All versions, Microsoft 365
Returns
A number from −1 to 1
Want to practice TANH in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox
Overview
TANH is SINH ÷ COSH. It squashes any number into the range −1 to 1, which is why it's used in machine-learning models.
Large positive inputs approach 1, large negative approach −1.
Syntax
=TANH(number) Explain
Arguments
| Argument | Required? | What it does |
|---|---|---|
| number | Yes | Any real number. |
Examples
Example 1 — Squashing values
Big inputs flatten out near ±1.
B2fx=TANH(A2)
| A | B | |
|---|---|---|
| 1 | x | tanh x |
| 2 | 0 | 0 |
| 3 | 0.5 | 0.4621 |
| 4 | 3 | 0.9951 |
=TANH(A2) Explain
Common mistakes
- Not an angle. TANH doesn't use radians or degrees.
Notes

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.