# Bayes Theorem Calculator

Calculate posterior probability P(A given B) using prior, likelihood, and false-positive rate

> Canonical page: https://elysiatools.com/en/tools/bayes-theorem-calculator

- **Category:** Math & Numbers

- **Keywords:** bayes theorem, posterior probability, prior probability, likelihood, false positive, statistics

## Overview

Apply Bayes theorem.

Bayes theorem updates a prior probability after new evidence appears:

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

This is useful for diagnostic tests, spam filters, risk scoring, and evidence-based decision making.

## Inputs

- **Prior P(A)** (number)
- **Likelihood P(B given A)** (number)
- **False Positive P(B given not A)** (number)
- **Input Scale** (select)
- **Decimal Places** (number)

## When to use

- Evaluating the actual probability of having a condition after receiving a positive medical test result.
- Updating risk models or fraud detection algorithms when new behavioral evidence is observed.
- Solving statistics and probability problems that require applying Bayes' theorem to conditional probabilities.

## How it works

- Enter the prior probability (base rate) of the event occurring before any evidence is known.
- Input the likelihood (true positive rate) and the false-positive rate of the test or evidence.
- Select your preferred input scale (percentages or proportions) and set the desired decimal precision.
- The calculator applies Bayes' theorem to output the updated posterior probability as both a proportion and a percentage.

## Use cases

- Medical diagnostics to calculate the true chance of illness given a positive screening test and known disease prevalence.
- Machine learning and spam filtering to determine the probability that an email is spam given the presence of specific trigger words.
- Quality control in manufacturing to assess the likelihood that a flagged component is actually defective.

## Frequently asked questions

### What is prior probability?

Prior probability, or base rate, is the initial estimated likelihood of an event occurring before any new evidence or test results are considered.

### What does likelihood mean in this calculator?

Likelihood represents the true positive rate, or the probability that the evidence (such as a positive test result) appears when the event is actually true.

### Why is the posterior probability often lower than expected?

If the prior probability (base rate) is very low, even a highly accurate test with a small false-positive rate will yield a surprisingly low posterior probability. This statistical phenomenon is known as the base rate fallacy.

### Can I input values as decimals instead of percentages?

Yes, you can change the Input Scale setting from 'Percent' to 'Proportion' to enter decimal values like 0.01 instead of 1%.

### What is the false-positive rate?

The false-positive rate is the probability that the evidence or test result is positive even when the underlying event is false.

## Related tools

- [Active Earth Pressure (Rankine)](https://elysiatools.com/en/tools/active-earth-pressure): Calculate the Rankine active earth pressure on a smooth vertical wall backfilled with cohesionless soil. K_a = tan²(45°−φ/2). Optional uniform surcharge q. Returns the base pressure p₀, the total force P, and the resultant height.
- [Bearing Capacity Calculator (Terzaghi)](https://elysiatools.com/en/tools/bearing-capacity-calculator): Calculate the Terzaghi ultimate bearing capacity of a shallow foundation: q_ult = c·Nc·sc + q·Nq·sq + 0.5·γ·B·Nγ·sγ. Computes Nc/Nq/Nγ and shape factors automatically; supports strip, square, and circular footings. Result in kPa.
- [Belt Pulley Speed Ratio Calculator](https://elysiatools.com/en/tools/belt-pulley-speed-ratio): Calculate the ratio, driven speed and belt linear speed of a belt drive. i = d₂/d₁ = n₁/n₂, belt speed v = π·d·n/60. Supports mm/cm/m/inch diameter units.
- [Bending Stress Calculator](https://elysiatools.com/en/tools/bending-stress-calculator): Calculate the maximum bending (flexural) stress σ_max = M·c/I = M/Z at the outermost fiber of a beam section. Supports solid circle, rectangle, hollow tube, and I-beam; computes I, section modulus Z, and distance c automatically. Stress in MPa.
- [Binomial Distribution Calculator](https://elysiatools.com/en/tools/binomial-distribution-calculator): Calculate exact, cumulative, and upper-tail binomial probabilities for independent Bernoulli trials
- [Break-Even Calculator](https://elysiatools.com/en/tools/break-even-calculator): Calculate the break-even point for a product or business based on fixed costs, variable costs, and price
- [Cantilever Beam Calculator](https://elysiatools.com/en/tools/cantilever-beam-calculator): Calculate the maximum bending moment M_max, maximum shear force V_max and free-end deflection δ_max of a cantilever beam under a free-end point load P or a uniformly distributed load q. Point load: δ = PL³/(3EI); UDL: δ = qL⁴/(8EI).
- [Column Buckling Load Calculator (Euler)](https://elysiatools.com/en/tools/column-buckling-load): Calculate the Euler critical buckling load of an axially loaded column: P_cr = π²·E·I/(K·L)². Supports pinned-pinned (K=1), fixed-free (K=2), fixed-pinned (K=0.7), fixed-fixed (K=0.5). Returns effective length, radius of gyration, slenderness ratio λ, and critical stress σ_cr.

## Samples

- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Web Image Processing Rust Samples](https://elysiatools.com/en/samples/web-image-processing-rust): Web Rust image processing examples including image read/save, scaling, and format conversion
