Conditional Probability Calculator

This calculator works out conditional probability - the chance that event A is true given that you have observed evidence B - using Bayes' theorem. It suits situations like interpreting a medical test result, a spam filter flag, or a quality control failure, where one piece of evidence needs weighing against how common the underlying event actually is. You enter three percentages: the prior probability P(A), how likely A is before you see any evidence, such as how common a disease is in the population tested; the true positive rate P(B|A), how often the evidence appears when A is true; and the false positive rate P(B|not A), how often the evidence appears even when A is false. From these three inputs the calculator instantly returns P(A|B), the updated probability of A now that B has occurred, alongside P(A|not B), the total probability of the evidence P(B), and P(not A|B). A calculation breakdown shows every intermediate step, including the joint probabilities P(A and B) and P(not A and B), plus a worked example using the default figures so you can check the maths. A plain-English verdict below the results explains whether the evidence has raised or lowered the probability of A, and by how much. Results are mathematically exact for the probabilities you supply, so make sure your estimates are realistic before relying on the output.

Calculate.co.nz is proud to be partnered with Premium Homes, a recognised leader in eco-friendly, sustainable, and energy-efficient homebuilding. With a dedicated team and award-winning experience, they create homes that prioritise health, comfort, and long-term performance. Their founders, Andrew and Kelly, set out to raise the standard of residential construction in New Zealand by combining practical building expertise with a clear commitment to doing things better for homeowners.
Calculate.co.nz partner: Premium Homes
Standard formula  Bayes' theorem: P(A|B) = P(B|A) x P(A) / P(B). Results are exact given the inputs you provide.

1. Prior and Evidence Rates

%
Enter a value between 0 and 100.
%
Enter a value between 0 and 100.
%
Enter a value between 0 and 100.

2. What the Inputs Mean

Use a medical test as an example:

  • P(A): how common is the condition in the population being tested?
  • P(B|A): if a person has the condition, how often does the test correctly come back positive?
  • P(B|not A): if a person does not have the condition, how often does the test incorrectly come back positive?

The calculator works for any A and B, not just medical tests.

Conditional Probability Results

P(A|B)
-
Prob. of A given B occurred
P(A|not B)
-
Prob. of A given B did not occur
P(B)
-
Total probability of B
P(not A|B)
-
Prob. A did not occur given B

Calculation Breakdown

Prior P(A)-
Prior P(not A)-
True positive rate P(B|A)-
False positive rate P(B|not A)-
P(A and B) = P(B|A) x P(A)-
P(not A and B) = P(B|not A) x P(not A)-
P(B) = P(A and B) + P(not A and B)-
P(A|B) = P(A and B) / P(B)-

Worked Example Check

With the default inputs (P(A)=30%, P(B|A)=70%, P(B|not A)=20%):

P(A and B)0.70 x 0.30 = 0.2100
P(not A and B)0.20 x 0.70 = 0.1400
P(B)0.2100 + 0.1400 = 0.3500
P(A|B)0.2100 / 0.3500 = 60.00%

Even though A has only a 30% prior probability, the positive evidence of B raises it to 60%. This is the core insight of Bayesian reasoning.

Result: Enter your values above to see the conditional probability.

What Is Conditional Probability?

Conditional probability is the probability that event A will occur, given that event B has already occurred. It is written P(A|B), which is read as "the probability of A given B". The vertical bar means "given that".

The basic formula is:

P(A|B) = P(A and B) / P(B)

If you know P(A), P(B|A) and P(B|not A), you can use Bayes' theorem to compute P(A|B) without knowing P(A and B) directly.

Bayes' Theorem

Bayes' theorem expands the conditional probability formula so you can compute P(A|B) from three quantities you typically do know:

P(A|B) = P(B|A) x P(A) / [ P(B|A) x P(A) + P(B|not A) x P(not A) ]

The numerator is P(A and B). The denominator is the total probability of B, using the law of total probability: P(B) = P(B|A) x P(A) + P(B|not A) x P(not A).

Step-by-Step Method

  1. Identify the prior probability P(A): how likely is A before observing B?
  2. Identify the true positive rate P(B|A): if A is true, how often is B observed?
  3. Identify the false positive rate P(B|not A): if A is false, how often is B still observed?
  4. Calculate P(A and B) = P(B|A) x P(A).
  5. Calculate P(not A and B) = P(B|not A) x P(not A), where P(not A) = 1 - P(A).
  6. Calculate total P(B) = P(A and B) + P(not A and B).
  7. Divide: P(A|B) = P(A and B) / P(B).

Worked Example (Default Values)

StepCalculationValue
Prior P(A)Given0.30
Prior P(not A)1 - 0.300.70
True positive P(B|A)Given0.70
False positive P(B|not A)Given0.20
P(A and B)0.70 x 0.300.2100
P(not A and B)0.20 x 0.700.1400
P(B)0.2100 + 0.14000.3500
P(A|B)0.2100 / 0.35000.6000 (60.00%)

Why This Matters: The Base Rate Effect

Conditional probability is counterintuitive when the base rate (prior probability) is very different from 50%. Consider a rare disease with a prevalence of 1% in the tested population. A test with a 99% true positive rate and a 5% false positive rate gives:

Even with a highly accurate test, a positive result in a low-prevalence population still has an 83% chance of being a false alarm. This is why screening programmes are targeted at higher-risk groups, where the prior probability is higher.

Common Applications

P(A|not B): Probability Given No Evidence

This calculator also shows P(A|not B), the probability of A given that B did not occur. This uses the same Bayes structure with P(not B|A) = 1 - P(B|A) and P(not B|not A) = 1 - P(B|not A). A negative result updates the prior downward by a factor that depends on how reliable the test is at ruling out A.

Related Calculators

Sources and method: Bayes' theorem from T. Bayes (1763), published posthumously in Philosophical Transactions of the Royal Society. Law of total probability: standard probability theory. Formula reference: DeGroot and Schervish, Probability and Statistics, 4th edition.

Results are mathematically exact given the input probabilities you supply. The calculator assumes the inputs are independent and that A and B are well-defined mutually understood events. It does not perform statistical inference from raw data.

If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.

Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.

Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.

All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.

Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.

Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.

Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.

All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.

About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use

Reviewed and maintained. Last reviewed 2026-07-19 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.

© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.