MaisTools
Calculator/

Bayes Calculator

Applies Bayes' theorem to compute conditional probabilities, including positive and negative predictive values for diagnostic tests.

Input values
%

Probability of A before observing B.

%

Probability of B when A is true.

%

Probability of B when A is false.

Result
Fill in all three percentages to see the result.

About this tool

Applies Bayes' theorem to compute conditional probabilities from a prior probability, sensitivity, and specificity. Shows positive and negative predictive values, useful for interpreting diagnostic tests (medical, drug, antivirus) and for any problem where you need to update a belief based on new evidence.

How to use

  1. Enter the prevalence or prior probability (frequency of the condition in the population).
  2. Enter the test sensitivity (how many true positive cases it detects).
  3. Enter the specificity (how many true negative cases it correctly identifies).
  4. See the positive and negative predictive values.

Frequently asked questions

What are positive and negative predictive values for?
Positive predictive value is the probability you actually have the condition given that the test came back positive. Negative predictive value is the probability you don't, given a negative result. They're more useful in practice than sensitivity and specificity alone, because they answer what matters when you have a concrete result.
Why can a very sensitive test produce many false positives?
When a condition is rare in the population (low prevalence), even a test with 99% specificity generates many false positives in absolute terms, because there are so many true negatives that the 1% error accumulates. This is Bayes' paradox and is why screening tests must be interpreted carefully.
How do I know which prevalence to use?
Ideally from epidemiological studies. In medical diagnosis it varies a lot between populations: mass screenings use the general prevalence, whereas for a patient with specific symptoms the prior is higher (adjusted based on the clinical picture). Without real data, you can try several values to see how sensitive the result is.