Probability Calculator

Bayesโ€™ Theorem Conditional AND / OR / NOT Free ยท No Signup

Free online probability calculator with four modes: basic probability (favorable/total), conditional P(A|B), Bayesโ€™ theorem posterior, and multiple events (AND, OR, NOT). Step-by-step KaTeX formulas, interpretation, and Python code export.

Probability Calculator
P(A) = favorable / total

Result

๐ŸŽฒ

Enter values and click Calculate

Compute probability using basic rules, conditional probability, or Bayesโ€™ theorem.

Python Compiler

Probability Fundamentals

Probability measures the likelihood of an event occurring, expressed as a number between 0 (impossible) and 1 (certain). It is the foundation of statistics, machine learning, and decision-making.

Basic Probability:  P(A) = Favorable Outcomes / Total Outcomes
๐ŸŽฒ

Complement Rule

P(ยฌA) = 1 โˆ’ P(A). The probability an event does not happen.

โž•

Addition Rule (OR)

P(A โˆช B) = P(A) + P(B) โˆ’ P(A โˆฉ B). Subtract the overlap.

โœ–๏ธ

Multiplication Rule (AND)

P(A โˆฉ B) = P(A) ร— P(B|A). For independent events: P(A) ร— P(B).

Conditional Probability & Bayesโ€™ Theorem

Conditional:  P(A|B) = P(A โˆฉ B) / P(B)
Bayesโ€™ Theorem:  P(A|B) = P(B|A) ร— P(A) / [P(B|A) ร— P(A) + P(B|ยฌA) ร— P(ยฌA)]
Medical Test Example: A disease affects 1% of the population. A test has 95% sensitivity and 5% false positive rate. If you test positive, what is the probability you have the disease?
P(Disease) = 0.01, P(+|Disease) = 0.95, P(+|Healthy) = 0.05
P(+) = 0.95 ร— 0.01 + 0.05 ร— 0.99 = 0.059
P(Disease|+) = (0.95 ร— 0.01) / 0.059 = 0.161 (16.1%)
Despite a โ€œ95% accurateโ€ test, there is only a 16% chance of having the disease!

Independent vs. Mutually Exclusive Events

PropertyIndependent EventsMutually Exclusive Events
DefinitionOne event does not affect the otherEvents cannot both occur
P(A โˆฉ B)P(A) ร— P(B)0
P(A โˆช B)P(A) + P(B) โˆ’ P(A)P(B)P(A) + P(B)
ExampleCoin flip and die rollDrawing a red or blue ball
Can both occur?YesNo

Real-World Applications

Medical Diagnosis

Bayesโ€™ theorem updates disease probability after test results, accounting for base rates and test accuracy.

Spam Filtering

Naรฏve Bayes classifiers compute the probability an email is spam given the words it contains.

Insurance & Risk

Actuaries use conditional probabilities to assess risk and calculate premium rates.

Games & Sports

Poker odds, win probability given the current game state, expected value of bets.

Frequently Asked Questions

Independent events do not affect each other, so P(A โˆฉ B) = P(A) ร— P(B). Mutually exclusive events cannot both occur, so P(A โˆฉ B) = 0. These are different concepts: two events can be independent but not mutually exclusive, and vice versa.
Bayesโ€™ theorem updates a prior probability P(A) based on new evidence B. The posterior P(A|B) = P(B|A) ร— P(A) / P(B). It is widely used in medical testing, spam filtering, and machine learning.
Conditional probability P(A|B) is the probability of event A occurring given that B has already occurred. The formula is P(A โˆฉ B) / P(B). It narrows the sample space to only outcomes where B is true.
Use the addition rule: P(A โˆช B) = P(A) + P(B) โˆ’ P(A โˆฉ B). For mutually exclusive events, P(A โˆฉ B) = 0, so it simplifies to P(A) + P(B). Always subtract the overlap to avoid double-counting.
Probability is favorable outcomes divided by total outcomes, ranging from 0 to 1. Odds are favorable to unfavorable (e.g., 3:2). Convert odds to probability: p = favorable / (favorable + unfavorable).
When a disease is rare (low prior), even a highly accurate test produces many false positives from the large healthy population. This is the base rate fallacy. Bayesโ€™ theorem correctly accounts for it, showing the posterior can be much lower than expected.

Support This Free Tool

Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site โ€” you're helping me build what developers actually need.

500K+ users
200+ tools
100% private
Privacy Guarantee: Private keys you enter or generate are never stored on our servers. All tools are served over HTTPS.