Conditional Probability Calculator
Calculate P(A|B) from joint and marginal probabilities, or apply Bayes' theorem to find P(A|B) from P(B|A), P(A), and P(B). Includes a visual probability tree.
Formula
P(A|B) = P(A∩B) / P(B)
Formula
P(A|B) = P(B|A) × P(A) / P(B)
Result
P(A|B)
—
As percentage
—
P(A'|B) complement
—
P(A∩B) joint
—
Probability Tree Diagram
Enter values and calculate to see the tree
Event B occurs
Event B does not occur
A given B (highlighted result)
Other branches
How to Read This
Summary
Calculate P(A|B) from joint and marginal probabilities, or apply Bayes' theorem to find P(A|B) from P(B|A), P(A), and P(B). Includes a visual probability tree.
How it works
- Pick a mode: direct definition or Bayes' theorem.
- In direct mode, enter the joint probability P(A∩B) and the marginal probability P(B); the tool divides them to give P(A|B).
- In Bayes mode, enter the likelihood P(B|A), the prior P(A), and the marginal P(B); the tool returns P(A|B) = P(B|A)·P(A) / P(B).
- All inputs must be between 0 and 1; invalid or inconsistent values (e.g. P(A∩B) > P(B)) trigger inline error messages.
- The color-coded probability tree updates live so you can see how the joint, marginal, and conditional values relate.
Use cases
- Medical testing: find the probability that a patient has a disease given a positive test result.
- Spam filtering: compute the probability that an email is spam given certain keywords.
- Quality control: determine the probability a product is defective given it failed an inspection.
- Finance: estimate the probability of a market downturn given a specific economic indicator.
- Legal reasoning: evaluate the probability of guilt given available evidence (Bayesian reasoning).
Frequently Asked Questions
Last updated: 2026-06-13 ·
Reviewed by Nham Vu