Everyday tool

Probability Calculator

Enter P(A), P(B) and P(A and B) as decimals from 0 to 1.

Runs in your browser. No upload.

Values are processed locally in this browser.

Result

—

About this tool

Probability Calculator made simple.

The calculator uses the event probabilities you provide. It does not assume independence; enter the intersection probability explicitly.

Guide

Using Probability Calculator

This probability calculator works with two events, A and B. You type the chance of A, the chance of B and the chance that both happen, each as a decimal from 0 to 1. It returns the chance of A or B, the chance that A does not happen, and the two conditional probabilities: A given B and B given A. It does not assume the events are independent, and it does not tell you whether your starting numbers are realistic.

How to use it

  1. Write the chance of event A as a decimal between 0 and 1. Use 0.25 for 25 percent. Percent signs and fractions are not accepted.
  2. Write the chance of event B in the same way.
  3. Write the chance that A and B both happen, called the intersection. It cannot be larger than the smaller of the first two numbers.
  4. Press Calculate and read the four lines of the result. Press Copy result to take them with you, or Clear to start again.

Worked examples

The default values

You enter
P(a)
0.5
P(b)
0.4
P(a and b)
0.2
You get
P(a or b)
0.7
P(not a)
0.5
P(a given b)
0.5
P(b given a)
0.4

The chance of either is 0.5 + 0.4 − 0.2 = 0.7. Here 0.5 × 0.4 equals 0.2, so the two events behave as independent: knowing B did not change the chance of A.

Run through the tool’s own code.

Events that influence each other

You enter
P(a)
0.4
P(b)
0.5
P(a and b)
0.3
You get
P(a or b)
0.6
P(not a)
0.6
P(a given b)
0.6
P(b given a)
0.75

A given B is 0.3 ÷ 0.5 = 0.6, higher than the plain 0.4. B given A is 0.3 ÷ 0.4 = 0.75. The events are linked, because the intersection is not 0.4 × 0.5.

Run through the tool’s own code.

Events that cannot happen together

You enter
P(a)
0.3
P(b)
0.5
P(a and b)
0
You get
P(a or b)
0.8
P(not a)
0.7
P(a given b)
0
P(b given a)
0

With an intersection of 0, the chances simply add up to 0.8. If one event happens, the other cannot, so both conditional probabilities are 0.

Run through the tool’s own code.

Numbers that do not fit together

You enter
P(a)
0.9
P(b)
0.9
P(a and b)
0.5
You get
Message
Use probabilities from 0 to 1 and an intersection valid for both events.

Two events that are each 90 percent likely must overlap by at least 0.9 + 0.9 − 1 = 0.8. An intersection of 0.5 is too small, so the tool refuses to calculate.

Run through the tool’s own code.

When it helps

  • Check homework on the addition rule and on conditional probability.
  • Find the chance of at least one of two outcomes when you know how often each and both occur.
  • Turn survey results, such as how many people own a bike, a car or both, into probabilities for further analysis.
  • Test whether two events look independent by comparing P(A and B) with P(A) times P(B).
  • Get a quick second opinion on a hand calculation before you hand it in.

Limits to keep in mind

  • All three inputs must be decimals from 0 to 1. The intersection must be at least P(A) + P(B) − 1 and at most the smaller of P(A) and P(B), or the tool shows an error.
  • The tool only handles two events and gives four results. It does not show P(not B), the chance of exactly one event, or an independence verdict.
  • Results are shown with up to six decimal places and trailing zeros are dropped, so a long decimal may be rounded in the display.
  • When P(B) is 0 the tool says P(A given B) is undefined, and when P(A) is 0 it says the same for P(B given A).
  • The output is only as good as the numbers you enter. The tool cannot check that your chances are realistic for your situation.

Tips

  • Convert percentages to decimals before you type them: divide by 100, so 35 percent becomes 0.35.
  • If you only know that A and B are independent, multiply the first two numbers yourself and type the product as the third.
  • Compare P(A given B) with P(A). If they are equal, B gives no information about A.
  • Write a one-line description of each event first, so you do not swap A and B when you read the conditional lines.

Common questions

About Probability Calculator.

How do I calculate the probability of A or B?

Add the chance of A and the chance of B, then subtract the chance that both happen. That is the addition rule, P(A or B) = P(A) + P(B) − P(A and B). The calculator does this and shows the result on the first line.

What is the difference between P(A given B) and P(A and B)?

P(A and B) is the chance that both events happen out of all cases. P(A given B) looks only at the cases where B happened and asks how often A happened there. It equals P(A and B) divided by P(B).

Does the calculator assume the events are independent?

No. You enter the intersection yourself, so it works for events that influence each other. If you know they are independent, multiply P(A) by P(B) and enter that product as the intersection.

Why does the tool refuse my numbers?

The three values must fit together. The intersection can never be bigger than P(A) or P(B), and it must be at least P(A) + P(B) − 1. Any value outside 0 to 1, or an empty box, also causes an error message.

Can I enter percentages or fractions?

Use decimals between 0 and 1. A value like 50 is rejected as out of range, and the number box does not read fractions like 1/2. Divide percentages by 100 first, so 50 percent becomes 0.5.

What does undefined mean in the result?

It appears when the event you are conditioning on has probability 0. Asking how often A happens when B never happens has no meaning, so the tool says P(A given B) is undefined because P(B) is zero.

Can I use this for dice, coins or cards?

Yes, if you work out the three probabilities yourself first. For example, for one die, A could be an even number (0.5), B a number above 3 (0.5) and both (two of six outcomes, about 0.333333). The tool does not count outcomes for you.

What if I need more than two events?

This tool covers two events only. For three or more events, or for binomial, normal and Poisson models, you need a different calculation. Check that the method you pick fits the way your data was collected.

Is my data uploaded?

No. The calculation runs in your browser and the numbers you type are not uploaded. Use Copy result if you want to keep the four lines for later.

How do I use Probability calculator?

Enter P(A), P(B) and P(A and B) as decimals from 0 to 1.

Is my data uploaded to a server?

No. This tool runs locally in your browser. Your input is not uploaded.