Probability Calculator

Complement, AND/OR for independent events, and Bayes.

Free probability calculator. Find the complement of an event, combine two independent events with AND and OR, or apply Bayes theorem for a conditional probability. Runs entirely in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How do I combine two independent events?

For independent events, P(A and B) is P(A) times P(B). P(A or B) is P(A) plus P(B) minus P(A and B), which avoids double-counting the overlap.

Probability calculator

Three common calculations in one tool: the complement of a single event, the combined probability of two independent events with AND and OR, and Bayes’ theorem for a conditional probability. It covers the everyday probability questions in statistics, risk, testing and games of chance.

How it works

Pick a mode and enter probabilities as decimals between 0 and 1:

Complement:   P(not A) = 1 − P(A)
Independent:  P(A and B) = P(A) × P(B)
              P(A or B)  = P(A) + P(B) − P(A) × P(B)
Bayes:        P(A|B) = [P(B|A)·P(A)] /
                       [P(B|A)·P(A) + P(B|¬A)·(1 − P(A))]

The OR formula subtracts the overlap so the shared outcome is not counted twice. Bayes combines a prior, a likelihood and a false-positive rate.

Worked examples

Complement. If the probability of rain is P(A) = 0.3, the probability it does not rain is P(not A) = 1 − 0.3 = 0.7. The complement of any event always adds to 1.

Two independent events. You flip a fair coin (P(heads) = 0.5) and roll a die hoping for a six (P(six) = 0.167). The chance of both: 0.5 × 0.167 = 0.083, about 1 in 12. The chance of at least one: 0.5 + 0.167 − 0.083 = 0.583.

Bayes’ theorem — why positive tests can still be mostly wrong. Suppose a rare condition affects 1% of the population (prior P(A) = 0.01). A test correctly identifies affected people with 99% sensitivity (P(B|A) = 0.99) but has a 5% false-positive rate among healthy people (P(B|¬A) = 0.05).

Given a positive test, the probability of actually having the condition:

P(A|B) = (0.99 × 0.01) / (0.99 × 0.01 + 0.05 × 0.99)
       = 0.0099 / (0.0099 + 0.0495)
       ≈ 0.167

Only about 17% — despite the test being highly accurate. This is the base-rate fallacy in action: when the prior probability is low, even a good test produces more false positives than true positives in absolute terms.

ModeInputsResult
ComplementP(A) = 0.30.70
ANDP(A)=0.5, P(B)=0.40.20
ORP(A)=0.5, P(B)=0.40.70
BayesPrior=0.01, Sens=0.99, FP=0.05≈ 0.167

When to use each mode

  • Complement is the fastest calculation in probability — if you know the chance of something happening, the chance of it not happening is always 1 minus that.
  • AND / OR for independent events applies when neither event influences the other: rolling dice, drawing cards with replacement, independent component failures in a reliability analysis.
  • Bayes mode is the right tool whenever you need to reason from a test result back to a hypothesis: medical screening, spam filtering, fraud detection, A/B test interpretation, or any situation where you start with a prior belief and update it given evidence.

Common mistakes

  • Using the AND formula for non-independent events. If events are correlated — weather on Tuesday and Wednesday, or two parts from the same production batch — the simple product formula is wrong. The AND mode is only valid when outcomes genuinely do not influence each other.
  • Forgetting the base rate in Bayes. Plug in the prior P(A) that reflects how common the condition actually is in the population being tested, not just how good the test is. The Bayes result is often counterintuitive precisely because people ignore the base rate.

Everything runs locally in your browser — no inputs are transmitted anywhere.