What Is a Logistic Function? The S-Curve Explained

A logistic function is a mathematical function that produces an S-shaped curve, starting with slow growth, accelerating through a middle phase, then leveling off at a maximum value. Its simplest form is f(x) = 1 / (1 + e⁻ˣ), where e is Euler’s number (roughly 2.718). The output always falls between 0 and some upper limit, which makes the logistic function useful anywhere you need to model something that grows quickly at first but can’t grow forever: populations, disease spread, adoption of new technology, or the probability that an email is spam.

The Shape and Why It Matters

Picture a quantity that starts near zero, rises slowly, then shoots upward, then gradually flattens out as it approaches a ceiling. That trajectory traces an S-curve (sometimes called a sigmoid curve, from the Latin for “S-shaped”). The logistic function is the most common equation that produces this shape.

The curve has three distinct phases. Early on, when the value is small relative to the ceiling, growth looks almost exponential: each step forward is bigger than the last. In the middle, the curve hits an inflection point, which is the moment of fastest growth. This inflection point sits exactly halfway between zero and the maximum value. After that, growth continues but decelerates, bending the curve toward a horizontal plateau. The function gets closer and closer to the ceiling but never quite reaches it.

The Three Parameters That Control the Curve

The general form of the logistic function is:

f(x) = L / (1 + e⁻ᵏ⁽ˣ⁻ˣ⁰⁾)

Three parameters shape the curve:

  • L (the maximum value): The ceiling the function approaches but never exceeds. In biology, this is called the carrying capacity. In a probability context, L is typically set to 1.
  • k (the growth rate): Controls how steep the middle portion of the S-curve is. A larger k produces a sharper transition from low to high; a smaller k stretches the curve out, making the climb more gradual.
  • x₀ (the midpoint): The x-value where the function reaches exactly half of L. This is also where the inflection point sits and where growth is fastest.

By adjusting these three numbers, you can fit the logistic curve to almost any real-world process that follows an S-shaped pattern.

Population Growth: The Original Use Case

The logistic function was first proposed in 1838 by the Belgian mathematician Pierre-François Verhulst, who was trying to predict population growth more realistically than simple exponential models allowed. His work was largely forgotten and only rediscovered in the 1920s.

Verhulst’s insight was straightforward. A population with unlimited food and space grows exponentially: the more individuals there are, the faster the population grows. But real environments have limits. Food runs out, habitats fill up, diseases spread more easily in dense populations. Verhulst added a braking term to the exponential equation to capture this.

The logistic growth equation for populations is often written as dN/dt = rN(1 − N/K), where N is the current population size, r is the maximum growth rate, and K is the carrying capacity of the environment. The term (1 − N/K) represents the fraction of the carrying capacity still “unused.” When the population is tiny compared to K, that fraction is close to 1, so growth is nearly exponential. As N approaches K, the fraction shrinks toward zero, and growth stalls. The result is the familiar S-curve: a population that explodes early, grows fastest at the halfway mark, then levels off near K.

Disease Spread and the S-Curve

Epidemiologists use the same mathematics to model how infections accumulate during an outbreak. The total number of infected people over time follows a pattern strikingly similar to Verhulst’s population model. Early in an epidemic, when nearly everyone is susceptible, cases grow exponentially. As more people become infected (and either recover with immunity or take precautions), the pool of susceptible individuals shrinks. Growth slows, and the cumulative case count levels off at some final total.

The logistic equation for cumulative infections takes the same form: N(t) = N∞ / (1 + ((N∞/N₀) − 1)e⁻ᵖᵗ), where N₀ is the initial number of cases, N∞ is the eventual total, and ρ is the infection rate. During the COVID-19 pandemic, researchers used variations of this model to estimate when outbreaks in different countries would peak and plateau, though real epidemics often deviate from the clean S-shape due to policy changes, new variants, and behavioral shifts.

Machine Learning and Probability

Outside of biology, the logistic function’s most widespread use today is in machine learning and statistics, where it goes by the name “sigmoid function.” Its key property for this purpose is that it takes any real number, positive or negative, and squashes it into a value between 0 and 1. That makes it a natural fit for modeling probabilities.

Logistic regression, one of the most commonly used classification algorithms, relies on this property. Say you want to predict whether a tumor is malignant or benign based on its size. A linear equation might produce a raw score of, say, 2.5 or −1.3. Feeding that score through the sigmoid function converts it to a probability between 0 and 1. If the output is 0.92, the model estimates a 92% chance the tumor is malignant. In practice, a threshold (usually 0.5) splits the output into a yes-or-no classification.

As the input grows very large and positive, the sigmoid output approaches 1. As the input grows very large and negative, the output approaches 0. Around zero, the function transitions smoothly between the two extremes. This behavior also makes the logistic function useful inside neural networks, where it serves as an activation function, helping layers of a network introduce nonlinearity so the system can learn complex patterns.

Sigmoid vs. Logistic: What’s the Difference

“Sigmoid” just means S-shaped. Technically, several different mathematical functions produce S-shaped curves, so “sigmoid function” is a broader category. The logistic function is the most common and well-known member of that category, which is why the two terms are often used interchangeably. In machine learning contexts, when someone says “sigmoid function,” they almost always mean the specific logistic function σ(x) = 1 / (1 + e⁻ˣ). The distinction only matters if you’re working with alternative S-shaped functions like the hyperbolic tangent or the error function.

Why the Logistic Function Keeps Showing Up

The logistic function appears across so many fields because the pattern it describes, growth that accelerates then hits a ceiling, is one of the most common dynamics in nature and technology. Product adoption follows it: a few early adopters, then rapid mainstream growth, then market saturation. Learning curves follow it: slow initial progress, a phase of rapid improvement, then diminishing returns. Chemical reactions, rumor spreading, and the charging of a capacitor all echo the same shape.

What makes the logistic function particularly useful, compared to just sketching an S-curve by hand, is that its three parameters (maximum value, growth rate, midpoint) are easy to estimate from data and easy to interpret. You can fit the equation to historical data, read off meaningful quantities like the expected ceiling or the point of fastest growth, and make quantitative predictions about timing and magnitude. That combination of simplicity, flexibility, and interpretability is why a function first proposed to study 19th-century Belgian demographics remains a workhorse of 21st-century data science.