Logistic Regression Calculator

Logistic regression models the probability of a yes-or-no outcome as a function of one or more predictors, and it is the standard method for classification problems in statistics, epidemiology and machine learning. Unlike linear regression, it passes a linear combination of the predictors through the logistic function, also called the sigmoid, so the result is always squeezed between zero and one and can be read as a probability. This calculator takes a fitted single-predictor model, with an intercept b0 and a slope b1, and a value of the predictor x, then returns the predicted probability that the outcome is one. It first computes the linear part, the log-odds z equal to b0 plus b1 times x, then applies the logistic function, one divided by one plus the exponential of negative z. The same z also gives the odds, the exponential of z, which is how much more likely the outcome is than not. Every figure is computed deterministically from the coefficients and predictor you enter, never estimated, so the same inputs always return the same probability. This tool evaluates a model you already have rather than fitting one from raw data. The method and a worked example that reconciles to the calculator default are shown in full below.

Logistic regression predicts a probability with p = 1 / (1 + e^-z) where z = b0 + b1*x. With b0 = -1.5, b1 = 0.8 and x = 2, z = 0.10 and the predicted probability is 0.52.

Source: US National Institute of Standards and Technology (NIST). As at 25 June 2026.

Log-odds z = b0 + b1 x--
Odds = e^z--
Predicted probability--

Formula

z = b0 + b1 x (the log-odds, or logit)
p = 1 / (1 + e^(-z)) (the logistic / sigmoid function)
odds = e^z = p / (1 - p)

The predictor is combined with the coefficients to give the log-odds z. The logistic function maps z to a probability between 0 and 1, and the exponential of z gives the odds of the outcome.

Worked example

Predict the probability for a model with intercept -1.5, slope 0.8 and predictor value x = 2.

  1. z = -1.5 + 0.8 x 2 = -1.5 + 1.6 = 0.10
  2. e^(-0.10) = 0.9048, so 1 + e^(-0.10) = 1.9048
  3. p = 1 / 1.9048 = 0.5250
  4. Rounded to two decimals the probability is 0.52

These are the calculator's default inputs, so the probability above matches the widget exactly.

Logistic Regression Calculator: frequently asked questions

What is the logistic function?

The logistic function, also called the sigmoid, is one divided by one plus the exponential of negative z. It maps any real number z to a value strictly between zero and one, which makes it ideal for modelling probabilities.

What is the log-odds?

The log-odds, or logit, is the linear part of the model, z equals b0 plus b1 times x. It is the natural logarithm of the odds, and the logistic function converts it back to a probability.

Does this calculator fit a model?

No. It evaluates a model you already have by plugging in the intercept, slope and predictor. Fitting the coefficients from raw data requires iterative estimation, which this tool does not perform.

How do I get the odds from the probability?

The odds equal the probability divided by one minus the probability, which is also the exponential of z. The calculator shows the odds alongside the probability.

Can I use multiple predictors?

This version uses a single predictor for clarity. For several predictors you would extend z to b0 plus b1 x1 plus b2 x2 and so on, then apply the same logistic function.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 25 June 2026. See our methodology. This is general information, not financial, tax, legal or investment advice.