Data Science & ML
Intermediate

Sigmoid Function

Maps any real number to the range (0, 1); used in logistic regression.

Formula

σ(x)=11+e−x\sigma(x) = \frac{1}{1 + e^{-x}}

Live Calculator

Members

Variables

xInput value
eEuler number

Example

\sigma(0) = 0.5

How it works

The sigmoid function turns any real-valued input into a number between 0 and 1 by comparing e^{-x} against 1 in the denominator. Large positive inputs make e^{-x} very small, so the output gets close to 1; large negative inputs make e^{-x} very large, so the output gets close to 0. This smooth S-shaped curve is useful when you want to interpret a model output as a probability-like value.

When to use it

Use the sigmoid when you need a smooth output bounded between 0 and 1, especially in binary classification models such as logistic regression. It is also common in neural networks for outputs that represent probabilities or gates.

Worked example, step by step

Compute sigma(2) step by step: sigma(2) = 1 / (1 + e^{-2}) First, evaluate the exponent: e^{-2}  0.1353 Substitute: sigma(2) = 1 / (1 + 0.1353) Add the denominator: 1 + 0.1353 = 1.1353 Divide: 1 / 1.1353  0.8808 Final answer: sigma(2)  0.8808

Common mistakes to avoid

  • Forgetting the negative sign in the exponent and using e^x instead of e^{-x}
  • Thinking the sigmoid can output exactly 0 or 1, when it only approaches those values
  • Confusing the input x with a probability instead of a real-valued score or logit

Did You Know?

The sigmoid was the classic neural-network activation before ReLU took over.

Share this formula

Reviewed & maintained by the FormulaWon editorial teamLast reviewed September 2026