Sigmoid Calculator

Calculate sigmoid activation function outputs and derivatives.

Sigmoid Function

f(x) = 1 / (1 + e^(-x))

f'(x) = f(x) * (1 - f(x))

Properties

  • - Output range: (0, 1)
  • - f(0) = 0.5
  • - Monotonically increasing
  • - Derivative max at x = 0 (0.25)

Sigmoid(0)

0.500000

50.00% probability interpretation

Derivative
0.250000
Log Odds
0.000000

Batch Results

x = -2f(x) = 0.1192f'(x) = 0.1050
x = -1f(x) = 0.2689f'(x) = 0.1966
x = 0f(x) = 0.5000f'(x) = 0.2500
x = 1f(x) = 0.7311f'(x) = 0.1966
x = 2f(x) = 0.8808f'(x) = 0.1050

What the Sigmoid Calculator Does

The sigmoid calculator evaluates the logistic sigmoid activation function and its derivative for any real input value. Given a single input x, it returns the sigmoid output, the slope of the curve at that point, the log-odds, and a probability interpretation expressed as a percentage. You can also paste a comma-separated list of values to compute a whole batch at once, which is handy when you want to inspect how a layer of pre-activation logits maps to bounded outputs.

The sigmoid function is one of the oldest and most intuitive activation functions in machine learning. It squashes any number on the real line into the open interval (0, 1), which makes its output behave like a probability. Because of this, sigmoid sits at the heart of logistic regression and of the output neuron in many binary classifiers. This calculator lets you build intuition for the function without writing code: type a logit, read the probability, and watch how the derivative shrinks toward zero as you move into the tails.

Under the hood the tool computes f(x) = 1 / (1 + e^(-x)) using the natural exponential, exactly as the page's JavaScript does. The derivative is computed from the elegant identity f'(x) = f(x) · (1 - f(x)), which means the slope can be read directly from the output without re-evaluating the exponential. The log-odds field inverts the sigmoid, returning the original logit, because the sigmoid and the logit are exact mathematical inverses. Together these four outputs give you a complete picture of a single neuron's behavior at any operating point, and the batch view extends that picture across a range of inputs so you can see the characteristic S-shaped curve emerge.

Sigmoid and Its Derivative

f(x) = 1 / (1 + e^(-x)), f'(x) = f(x) * (1 - f(x))

Where:

  • x= Input value (the pre-activation logit), any real number
  • f(x)= Sigmoid output, always strictly between 0 and 1
  • e= Euler's number, approximately 2.71828
  • f'(x)= Derivative (slope) of the sigmoid at x, with a maximum of 0.25 at x = 0

How to Use the Sigmoid Calculator

Using the sigmoid calculator takes only a moment. Enter a single input value x in the first field. This number is the raw logit, the kind of unbounded score that a linear layer produces before activation. Negative inputs push the output toward 0, positive inputs push it toward 1, and an input of exactly 0 lands on the midpoint 0.5.

  1. Type a single value. The big result tile shows the sigmoid output to six decimal places and a percentage probability beneath it.
  2. Read the derivative card. This tells you how sensitive the output is to small changes in x. The derivative peaks at 0.25 and falls off symmetrically.
  3. Check the log-odds card. Because log-odds is the inverse of sigmoid, it returns your original input x. This is a quick sanity check and a reminder that sigmoid converts log-odds into probability.
  4. Paste a list of values. Use the comma-separated field to compute a batch. The tool parses each number, ignores blanks, and lists the output and derivative for every entry.

The default batch of -2,-1,0,1,2 is deliberately chosen to trace the S-curve: the outputs climb from about 0.12 at -2 to 0.88 at +2, passing exactly through 0.5 at the origin. The derivatives are symmetric, peaking at the center and shrinking toward the tails. Watching these numbers change as you edit the list is the fastest way to internalize why deep sigmoid networks suffer from vanishing gradients: once a neuron saturates, its derivative becomes tiny and learning slows to a crawl. The calculator makes that effect visible without any training loop.

Interpreting the Outputs

Each of the four results from the sigmoid calculator answers a different question. The table below summarizes what every field means and how to read it in a modeling context.

Output Meaning Range
Sigmoid output f(x) Squashed activation, often read as a probability (0, 1)
Derivative f'(x) Slope used during backpropagation (0, 0.25]
Log-odds Inverse of sigmoid, equals the input x (-∞, +∞)
Probability % f(x) expressed as a percentage 0% to 100%

The probability interpretation is the most practical takeaway. In a binary classifier, the sigmoid output is the model's estimated probability that an example belongs to the positive class. A value of 0.731 means the model assigns roughly a 73.1% chance to the positive label. You typically apply a decision threshold of 0.5, classifying anything above it as positive, though that threshold can be tuned to trade precision against recall.

The derivative field is where the deep-learning subtleties live. Its bell shape, centered at x = 0 with a maximum of 0.25, means gradients are largest near the decision boundary and vanish as inputs grow large in magnitude. Because backpropagation multiplies derivatives layer by layer, stacking many sigmoids multiplies many values that are at most 0.25, and the product collapses toward zero. That is the precise mathematical reason modern architectures favor ReLU and its variants in hidden layers while reserving sigmoid for output gating and binary heads.

Sigmoid Versus Other Activations

Sigmoid is closely related to several other functions you will meet across the AI calculators on this site. Understanding the family helps you choose the right activation for a given layer.

  • Sigmoid vs. tanh: The hyperbolic tangent is a rescaled, recentered sigmoid: tanh(x) = 2·sigmoid(2x) - 1. Tanh outputs range from -1 to 1 and are zero-centered, which often makes optimization smoother than the strictly positive sigmoid output.
  • Sigmoid vs. softmax: Softmax generalizes sigmoid to multiple mutually exclusive classes. For a two-class problem, softmax over two logits reduces exactly to a sigmoid on their difference. Use sigmoid for binary or multi-label tasks and softmax for single-label multi-class tasks.
  • Sigmoid vs. ReLU: ReLU outputs max(0, x), is unbounded above, and has a constant gradient of 1 for positive inputs. It avoids saturation in the positive region, which is why it dominates hidden layers in deep networks. Sigmoid remains preferred for probabilistic outputs.

A defining property of sigmoid is saturation. For large positive or negative inputs the output flattens out and the derivative approaches zero. The batch view in the sigmoid calculator shows this plainly: at x = -2 and x = +2 the derivative has already dropped to about 0.105, less than half its peak. Push the input to ±6 and the derivative is essentially zero, meaning the neuron has effectively stopped learning. This saturation behavior is exactly what motivated the move to non-saturating activations in modern deep learning, yet sigmoid's bounded, interpretable output keeps it indispensable for gates in LSTMs and GRUs, for attention masks, and for the final layer of any model that must emit a probability.

Another reason sigmoid endures is its tight coupling with the binary cross-entropy loss. When you pair a sigmoid output with cross-entropy, the gradient with respect to the logit simplifies to (prediction minus target), a clean, well-behaved expression that sidesteps the saturation problem at the output layer. This synergy is why frameworks expose a fused "sigmoid cross-entropy" operation, and it is one more reason the function refuses to retire.

Common Use Cases and Practical Notes

The sigmoid calculator is useful any time you need to map an unbounded score onto a (0, 1) range or sanity-check a probability. Typical scenarios include the following.

  • Binary classification heads. Logistic regression and the final neuron of a spam filter, fraud detector, or click predictor all pass a logit through sigmoid to produce a probability.
  • Multi-label classification. When labels are not mutually exclusive (an image can be both "beach" and "sunset"), each output neuron uses an independent sigmoid rather than a shared softmax.
  • Gating mechanisms. LSTM and GRU cells use sigmoid gates valued between 0 and 1 to decide how much information to keep, forget, or write.
  • Attention and masking. Sigmoid gates can softly weight features, producing values that act like fractional switches.

A practical numerical note: the naive formula 1 / (1 + e^(-x)) can overflow for very large negative x because e^(-x) explodes. Production libraries use a numerically stable branch, but for the moderate inputs you will type into this calculator the direct formula is perfectly accurate. The tool reports outputs to six decimal places so you can see fine differences near the center of the curve where sensitivity is highest.

When you read the probability output, remember that calibration matters. A raw sigmoid probability is only as trustworthy as the model that produced the logit. Two models can both emit 0.9 while one is well calibrated and the other is overconfident. The calculator faithfully reports the mathematical mapping from logit to probability; judging whether that probability is reliable is a separate modeling concern involving validation data and calibration curves. Used as an intuition-builder and a quick reference, the sigmoid calculator turns abstract activation math into concrete, checkable numbers, which is exactly what you want when debugging a layer or teaching the logistic function to someone new.

Worked Examples

Sigmoid at the Origin

Problem:

Compute the sigmoid output, derivative, and probability for an input of x = 0.

Solution Steps:

  1. 1Apply the formula: f(0) = 1 / (1 + e^(-0)) = 1 / (1 + 1) = 1 / 2.
  2. 2The output is exactly 0.500000, the midpoint of the (0, 1) range.
  3. 3The derivative is f'(0) = f(0) * (1 - f(0)) = 0.5 * 0.5 = 0.250000, its maximum possible value.

Result:

f(0) = 0.500000, derivative = 0.250000, probability = 50.00%.

A Confident Positive Logit

Problem:

A binary classifier outputs a logit of x = 2. What probability does the sigmoid assign?

Solution Steps:

  1. 1Compute e^(-2) = 0.135335, so 1 + e^(-2) = 1.135335.
  2. 2f(2) = 1 / 1.135335 = 0.880797, which the tool shows as a probability of 88.08%.
  3. 3The derivative is f'(2) = 0.880797 * (1 - 0.880797) = 0.880797 * 0.119203 = 0.104994, already well below the peak of 0.25.

Result:

f(2) = 0.880797 (88.08% probability), derivative = 0.104994, log-odds = 2.000000.

Symmetry With a Negative Input

Problem:

Show that x = -1 mirrors x = 1 in output and shares the same derivative.

Solution Steps:

  1. 1f(1) = 1 / (1 + e^(-1)) = 1 / 1.367879 = 0.731059, while f(-1) = 1 / (1 + e^(1)) = 1 / 3.718282 = 0.268941.
  2. 2Note that 0.731059 + 0.268941 = 1.000000, confirming the symmetry f(-x) = 1 - f(x).
  3. 3Both derivatives equal 0.731059 * 0.268941 = 0.196612, because the derivative is symmetric about x = 0.

Result:

f(1) = 0.731059 and f(-1) = 0.268941; both have derivative 0.196612 and log-odds of +1 and -1 respectively.

Tips & Best Practices

  • An input of 0 always produces exactly 0.5, the natural decision boundary for binary classification.
  • The derivative peaks at 0.25 when x = 0 and falls off in both directions, so learning is fastest near the boundary.
  • Sigmoid is symmetric: f(-x) = 1 - f(x), which you can verify with the +x and -x pair in the batch field.
  • The log-odds output equals your input because sigmoid and the logit are exact inverses.
  • Inputs beyond roughly +6 or -6 saturate the output to nearly 1 or 0 with a near-zero derivative.
  • Pair sigmoid with binary cross-entropy loss so the output-layer gradient simplifies to prediction minus target.

Frequently Asked Questions

It evaluates the logistic sigmoid function f(x) = 1 / (1 + e^(-x)) for any real input. Alongside the output it returns the derivative f'(x) = f(x)(1 - f(x)), the log-odds, and a probability percentage. You can also enter a comma-separated list to compute many values at once.
The exponential e^(-x) is always positive, so 1 + e^(-x) is always greater than 1, which forces the fraction below 1. As x grows large the denominator approaches 1 and the output approaches 1, while as x grows very negative the denominator explodes and the output approaches 0. The endpoints are never reached, so the range is the open interval (0, 1).
Log-odds is the inverse of the sigmoid function. Since the page first applies sigmoid and then takes ln(f / (1 - f)), the two operations cancel and you recover the original input x. This is a useful sanity check and illustrates that sigmoid converts log-odds into probability.
The derivative f'(x) = f(x)(1 - f(x)) reaches its maximum of 0.25 at x = 0, where f(x) = 0.5. It is symmetric about the origin and shrinks toward zero in both tails. This small ceiling is the root cause of vanishing gradients in deep sigmoid networks.
Use sigmoid for binary classification and for multi-label problems where classes are not mutually exclusive, applying an independent sigmoid to each output. Use softmax when exactly one class should be chosen from several mutually exclusive options. For a two-class problem, softmax over two logits reduces to a single sigmoid on their difference.
Because sigmoid saturates, its derivative becomes tiny for large positive or negative inputs. Backpropagation multiplies these small derivatives across layers, so gradients shrink exponentially and early layers learn very slowly. Non-saturating activations like ReLU keep gradients healthier, which is why sigmoid is now reserved mainly for output layers and gates.

Sources & References

Last updated: 2026-06-05

💡

Help us improve!

How would you rate the Sigmoid Calculator?

<>

Editorial Note

MyCalcBuddy Editorial Team

This page is maintained as an educational calculator reference.

Source

Formula Source: Standard Mathematical References

by Various

UpdatedLast reviewed: May 2026
CheckedFormula checks are based on standard references and internal QA review.