# Bayes’ Theorem Calculator - Posterior Probability and Positive Predictive Value

> Free online Bayes calculator: enter a prior and likelihood (or prevalence, sensitivity, specificity) for the posterior, PPV, NPV and a natural frequency table.

- URL: https://qilingtools.com/en/math/bayes
- Category: Math Tools (https://qilingtools.com/en/math)
- Tags: [Math](https://qilingtools.com/en/tags/math), [Statistics](https://qilingtools.com/en/tags/statistics)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

Enter a prior and the likelihood of the evidence and get the posterior immediately. The medical mode takes prevalence, sensitivity and specificity and returns the positive and negative predictive values, then restates the result as natural frequencies — how many people out of ten thousand — which is far easier to reason about than bare percentages.

## How to use

1. Choose the general form or the medical testing mode
2. Enter the prior and the likelihoods (percentages such as 0.5% are accepted)
3. Read the posterior and how far the probability moved
4. Use the natural frequency table to sanity-check the result

## Features

- Posterior, evidence probability and the posterior after a negative result
- Medical mode reports positive and negative predictive values directly
- Prior odds, likelihood ratios LR+ and LR−, and posterior odds for odds-form reasoning
- Natural frequency table restating everything as counts per ten thousand (or per million)
- Built-in classics: breast cancer screening, a rare disease, a roadside alcohol test
- Inputs accept both 0.5%-style percentages and plain decimals

## FAQ

### Why can a 90%-accurate test be positive and still probably wrong?

Because the condition is rare. With 1% prevalence, 90% sensitivity and 91% specificity: out of ten thousand people, 100 are affected and 90 test positive, while about 891 of the 9,900 healthy ones also test positive. Of 981 positives only 90 are real — about 9%. That is what the frequency table makes visible.

### How do I choose the prior?

The base rate in the population (prevalence or incidence) is the safe default. If the individual has extra risk factors — family history, symptoms — a higher prior is appropriate, and the same test result then leads to a very different posterior.

### What is the difference between sensitivity and specificity?

Sensitivity is the share of affected people the test catches; specificity is the share of unaffected people it correctly clears. The false positive rate is 1 − specificity, and that is what determines how many false alarms come out of the healthy majority.

### How are likelihood ratios used?

LR+ = sensitivity / (1 − specificity). In odds form the arithmetic is easy: posterior odds = prior odds × LR+. A large LR+ moves your belief a lot, while an LR+ near 1 means the test carries almost no information.

### Is Bayes’ theorem only for medicine?

Not at all. Spam filtering, weighing evidence in court, machine fault diagnosis and A/B testing all use the same formula. The general mode is there for those: P(A) is the prior and P(B|A) the chance of seeing the evidence if the hypothesis holds.

## Related tools

- [Graphing Calculator](https://qilingtools.com/en/math/graph): Free online function graphing calculator: type sin(x), x^2 or 1/x and see the curve at once, with several functions, parametric and polar curves, PNG export.
- [Scientific Calculator](https://qilingtools.com/en/math/calculator): Free online scientific calculator: type 2*(3+4)^2, sin(pi/6) or log(8,2) and see the answer as you type, with degrees or radians and a history list.
- [Equation Solver](https://qilingtools.com/en/math/equation): Free online equation solver: enter coefficients for linear, quadratic (with discriminant, vertex and complex roots) and cubic equations, plus 2×2 systems.
- [Fraction Calculator](https://qilingtools.com/en/math/fraction): Free online fraction calculator: add, subtract, multiply and divide fractions with automatic reduction, plus fraction ↔ decimal with repeating digits.
- [Percentage Calculator](https://qilingtools.com/en/math/percentage): Free online percentage calculator: X% of Y, X as a percent of Y, increase and decrease, a value after a percentage change and the original behind it.
- [Prime Factorization](https://qilingtools.com/en/math/prime): Free online prime factorization: factor an integer with exponents, list every divisor and their sum, test primality with neighbouring primes, or list a range.
- [GCD and LCM](https://qilingtools.com/en/math/gcd-lcm): Free online GCD and LCM calculator: works with two or more integers, says whether they are coprime, shows each prime factorization and every Euclidean step.
- [Statistics Calculator](https://qilingtools.com/en/math/statistics): Free online statistics calculator: paste a data set for the mean, median, mode, range, quartiles, variance, standard deviation, standard error and outliers.
