Audited 31 Jul 2026·Last updated 31 Jul 2026·5 citations·Tier 1·0 uses

Bayes' Theorem Calculator

Calculate posterior probability from a prior event probability, true-positive conditional probability, and false-positive conditional probability with explicit

Bayes' Theorem Calculator

Posterior probability P(A|B)
0.6667
Result of P(A|B) = P(B|A)P(A) / [P(B|A)P(A) + P(B|not A)P(not A)] using the entered coherent-SI magnitudes.
Model scope
Two-state Bayes update with supplied conditional probabilities; it does not establish that events are exhaustive, select a prior, account for dependence or verification bias, or interpret a medical, legal, or operational decision.

Background.

Bayes' Theorem Calculator evaluates posterior probability from a prior event probability, true-positive conditional probability, and false-positive conditional probability. The page keeps every model input visible and uses the relationship P(A|B) = P(B|A)P(A) / [P(B|A)P(A) + P(B|not A)P(not A)]. It is designed for a transparent calculation where the quantities have already been measured or selected from an appropriate source. It does not choose a material, operating condition, reference state, or empirical coefficient on the user's behalf.

Enter prior probability p(a), p(b|a), p(b|not a) in the units printed beside the fields. These are coherent SI quantities, so the displayed equation can be followed without a hidden unit factor. A result is only comparable with another source when the same quantity definitions, reference conditions, and sign or magnitude convention are used. Record those conditions whenever the number supports engineering, laboratory, or coursework decisions.

The calculator performs arithmetic with Decimal.js and rounds once at the output boundary to twelve significant digits. That protects very small and very large scientific results from early decimal-place rounding. The tests do more than pin one example: they check the dimensional scaling implied by each variable, finite and positive domain guards, several orders of magnitude, and the formula-engine registration used by the live page.

Two-state Bayes update with supplied conditional probabilities; it does not establish that events are exhaustive, select a prior, account for dependence or verification bias, or interpret a medical, legal, or operational decision. The scope statement appears beside the numerical result because it changes how the answer may be used. A neat number does not remove uncertainty in measurements, material properties, geometry, calibration, or the assumptions used to reduce a real system to one equation.

Use scaling as a quick reasonableness check. If an input appears in the numerator, increasing it should move the result in the same direction; a denominator should move it in the opposite direction; a square-root term changes more slowly. If the page behaves differently from the displayed relationship, stop and review the units. The calculator rejects zero, negative, infinite, and nonnumeric quantities where the equation requires a positive magnitude.

This page is a calculation aid rather than a substitute for measurement standards, a laboratory method, or a discipline-specific design code. Keep more digits than the source data justify only while carrying intermediate work, and round the reported result to the uncertainty of the least certain input. If a source uses centimetre-gram-second units, customary units, gauge values, or a different reference temperature, convert and document those choices before entering the numbers.

This page is a calculation aid rather than a substitute for measurement standards, a laboratory method, or a discipline-specific design code. Keep more digits than the source data justify only while carrying intermediate work, and round the reported result to the uncertainty of the least certain input. If a source uses centimetre-gram-second units, customary units, gauge values, or a different reference temperature, convert and document those choices before entering the numbers.

This page is a calculation aid rather than a substitute for measurement standards, a laboratory method, or a discipline-specific design code. Keep more digits than the source data justify only while carrying intermediate work, and round the reported result to the uncertainty of the least certain input. If a source uses centimetre-gram-second units, customary units, gauge values, or a different reference temperature, convert and document those choices before entering the numbers.

What is bayes' theorem calculator?

Bayes' Theorem Calculator is a transparent implementation of P(A|B) = P(B|A)P(A) / [P(B|A)P(A) + P(B|not A)P(not A)] for posterior probability from a prior event probability, true-positive conditional probability, and false-positive conditional probability.

How to use this calculator.

  1. Confirm that the displayed quantity equation matches the model you intend to use.
  2. Convert every measurement to the SI unit printed beside its field.
  3. Enter sourced magnitudes and keep their reference conditions with the result.
  4. Read the numeric result together with the model-scope output.
  5. Round the reported value to the uncertainty supported by the inputs.

The formula.

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

The implementation evaluates P(A|B) = P(B|A)P(A) / [P(B|A)P(A) + P(B|not A)P(not A)] with Decimal.js. Inputs are required to be finite and positive because this page treats them as magnitudes. Arithmetic is not rounded between operations; each numeric output is rounded once to twelve significant digits. The scaling tests independently verify the power of every input in the equation.

A worked example.

Example

Using the displayed default inputs in P(A|B) = P(B|A)P(A) / [P(B|A)P(A) + P(B|not A)P(not A)] gives posteriorProbability = 0.666666666667. The calculation retains Decimal precision and rounds once at the result boundary.

true Positive Probability0.9
false Positive Probability0.05
prior Probability0.1

Frequently asked questions.

What equation does this bayes' theorem calculator use?
It uses P(A|B) = P(B|A)P(A) / [P(B|A)P(A) + P(B|not A)P(not A)]. Every required magnitude is entered explicitly, and no material or operating-condition lookup is hidden in the result.
Why must all inputs use the displayed units?
The equation is implemented in coherent SI units. Mixing a prefixed or customary-unit value into an SI field changes the number even when the physical situation is unchanged.
When should I not use this result?
Two-state Bayes update with supplied conditional probabilities; it does not establish that events are exhaustive, select a prior, account for dependence or verification bias, or interpret a medical, legal, or operational decision.
How is the result rounded?
Decimal arithmetic is carried through the equation and rounded once at the return boundary to twelve significant digits. Report fewer digits when the input uncertainty requires it.
How can I check the answer?
Follow the displayed equation, verify dimensions, and vary one input. The direction and exponent of the change should match the equation's numerator, denominator, or root.
Does the calculator choose reference data?
No. Entered material, reference-state, and operating-condition values remain the user's sourced inputs unless a field explicitly labels a versioned constant.
Can this replace a standard test method?
No. It evaluates a quantity equation. Measurement procedures, specimen preparation, calibration, and acceptance criteria remain in the applicable standard or technical method.
Why are zero and negative values rejected?
This page is defined for positive magnitudes, and the displayed division or root would be singular or outside that stated model at zero or a negative magnitude.

How this page was produced

Published by
Quanta Calculator
Primary sources
5 cited below
Method
P(A|B) = P(B|A)P(A) / [P(B|A)P(A) + P(B|not A)P(not A)]
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1120 calculators remain free
  • No billing is enabled
Coming soon