Elysia Tools

Browse tools, examples, visual explainers, and topic guides from one clear workspace.

Top Categories

Hubs

Language
ZHESPTRUFRDEEN

Elysia Tools

Navigation

Math & Numbers

Bayes Theorem Calculator

· Last updated:2026-04-30

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

Details

What this tool helps you do

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.

Execution

Run this tool

Fill in the form, run the tool, and review the result in one place.

Samples

Examples that match this tool

Related

Continue with connected tools and hubs

Written by the Elysia Tools team
Math502

Tool usage guide

Learn when to use this tool, what it supports, and how real users apply it.

Key facts

Category
Math & Numbers
Input types
number, select
Output type
json
Sample coverage
4
API ready
Yes

Overview

The Bayes Theorem Calculator allows you to determine the posterior probability of an event by updating its prior probability with new evidence. By inputting the base rate, likelihood (true positive rate), and false-positive rate, you can quickly evaluate the real-world accuracy of diagnostic tests, spam filters, and risk assessments without manually calculating complex conditional probability formulas.

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

  1. 1Enter the prior probability (base rate) of the event occurring before any evidence is known.
  2. 2Input the likelihood (true positive rate) and the false-positive rate of the test or evidence.
  3. 3Select your preferred input scale (percentages or proportions) and set the desired decimal precision.
  4. 4The 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.

Examples

1. Calculating Disease Probability After a Positive Test

Medical Student

Background

A student is analyzing a rare disease that affects 1% of the population. A test for the disease has a 99% true positive rate but a 5% false-positive rate.

Problem

Determine the actual probability that a patient has the disease if they test positive.

How to use

Set Prior P(A) to 1, Likelihood to 99, and False Positive to 5. Keep the input scale as Percent.

Prior: 1, Likelihood: 99, False Positive: 5, Scale: percent

Outcome

The calculator reveals a posterior probability of 16.6667%, demonstrating the base rate fallacy where a positive test does not guarantee the presence of the disease.

2. Updating Spam Probability

Data Scientist

Background

An email filter needs to classify incoming messages. Historically, 20% of all emails are spam. A specific keyword appears in 80% of spam emails, but also in 10% of legitimate emails.

Problem

Calculate the probability that an email is spam if it contains this keyword.

How to use

FAQ

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.

Home
Tools3208
Samples593
Visualizations469
Viewers103
Hubs237
Tags333
Images, Audio & Video657

Image, audio, and video processing, conversion, and optimization tools

Math, Date & Finance646

Calculators, numerics, date logic, statistics, and finance tools

Design & Color298

Color, layout, graphics, visual styling, and design helper tools

Text & Writing209

Writing, cleanup, formatting, extraction, and text analysis tools

Developer & Web193

Developer utilities, networking, web debugging, and automation helpers

Conversion & Encoding175

Format, file, archive, unit, and encoding conversion tools

Private Habit Records: Backup, Restore and Sharing Review
Article to X and LinkedIn Drafts: Fact Review and Handoff
Markdown Interactive Deck Review and Offline Handoff
Small-Room Furniture Layout Review and Move-In Handoff
FLAC/WAV Source Screening and Evidence Handoff

© 2026 Elysia Tools. All rights reserved.

DocsPricingAboutTerms of ServicePrivacy PolicyCookiesContact
Java

Android Image Processing Java Samples

Android Java image processing examples including reading/saving images, scaling, and format conversion

Kotlin

Android Image Processing Kotlin Samples

Android Kotlin image processing examples including reading/saving images, scaling, and format conversion

Python

Web Image Processing Python Samples

Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion

Rust

Web Image Processing Rust Samples

Web Rust image processing examples including image read/save, scaling, and format conversion

Math & Numbers

Active Earth Pressure (Rankine)

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.

Math & Numbers

Bearing Capacity Calculator (Terzaghi)

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.

Math & Numbers

Belt Pulley Speed Ratio Calculator

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.

Math & Numbers

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.

Enter 20 for Prior P(A), 80 for Likelihood, and 10 for False Positive Rate.

Prior: 20, Likelihood: 80, False Positive: 10, Scale: percent

Outcome

The posterior probability updates to 66.6667%, indicating the email is significantly more likely to be spam when the keyword is present.