# RPG Math: Calculating Chance to Hit in D&D 5e

This time we will be system-specific and look into a valuable formula for D&D 5e, chance to hit. This formula will allow you to make an educated guess for how likely you are to hit your target with your spell or weapon attack. The best part is that the math is even easier than our previous article which was calculating the average dice roll! Let’s get to it.

## Definitions

#### Probability

The chance for a specific outcome to happen. When you see the word “chance” in mathematics, it’s safe to assume probability is involved.

#### Chance to Hit

The likelihood of landing a successful attack on your target. This is calculated as a percentage.

## Chance to Hit Formula

Chance to Hit = ( ( 21 – ( Target’s AC – Player’s Attack Bonus ) / 20 ) * 100

This is an extremely simple formula as we merely have to add all the numbers in the numerator together and then divide by 20. Next, we will multiply the decimal value by 100 to put it into the proper percentage format.

Why do we have a 21 in the numerator when we only have a 20-sided die? You will always have at least a 5% chance to hit any target in D&D 5e as rolling a 20 is an automatic hit. Conversely, you will never have a greater chance than 95% to hit as a 1 is an automatic miss.

## Examples

#### Fighter vs. Dragon

For our first example, we will be a fighter with a +9 to hit. Its target is an Adult Bronze Dragon with an AC of 19. This is going to be a tough fight. What’re our chances of dealing some damage?

1) Chance to Hit = ( ( 21 – ( 19 – 9) / 20 ) * 100
2) Chance to Hit = ( ( 21 – 10) / 20 ) * 100
3) Chance to Hit = ( 11 / 20 ) * 100
4) Chance to Hit = 55%

55% is certainly not the best odds, but worth a shot. This is a situation where you have found yourself swinging above your weight class.

#### Sorcerer vs. Ogre

In our second example, we are a sorcerer with a +7 to hit with our spells. Our target is an ogre with an AC of 11, which our frontline is keeping at bay for us to unleash our scorching ray.

1) Chance to Hit = ( ( 21 – ( 11 – 7 ) / 20 ) * 100
2) Chance to Hit = ( ( 21 – 4 ) / 20 ) * 100
3) Chance to Hit = ( 17 / 20 ) * 100
4) Chance to Hit = 85%

85% are some great odds! However, this is only the chance for a single ray to hit. What if we wanted to know what the likelihood of all 3 rays hitting was?

While it’s a bit more tricky, all you’ll have to do is take the value of your chance to hit and raise it to the power of attack rolls you are making. In our case, we have 3 rays so we will take 0.85³ which is 0.614125. This is roughly 61.4%. We have an above-average chance at hitting with all 3 of our rays which is pretty rare.

## Use Cases

The obvious use case for this formula is to calculate our chance to hit an enemy. However, we can also use it to determine our likelihood of success on ability checks and saving throws in D&D, given that we know the DC. Simply change the formula to the following:

Chance to Succeed = ( ( 20 – ( DC of the check – Ability Score – Proficiency) / 20 ) * 100

Did you notice that we are using 20 instead of 21? Although it is a popular house rule, a natural 20 is not an automatic success on saving throws and ability checks. Likewise, a natural 1 is not an automatic failure. Therefore, our maximum chance to hit with this formula is 100% and our minimum chance to hit is 0%.

Knowing how to use this formula can grant you many advantages in D&D. There are many situations in which missing an attack or failing a check is worse than attempting the action. Having the ability to know when to avoid these checks can be the difference between life and death.

## Conclusions

My intentions for this semi-regular series is not to have a lot of D&D 5e-specific formulas. However, I felt that this formula is a great introduction to calculating basic probabilities. Having an understanding of probability will be helpful for the more complex formulas in RPGs! I’ve written a different article on calculating probability before as well.

It is possible to calculate your chance to hit with advantage and disadvantage. However, I will save that for another post where I can go into much more detail on the math as it is much more complicated. I also intend to write an entire post on advantage and disadvantage beforehand.

Depending on the system you are playing this formula could be tweaked based on how your dice rolls, bonuses, and enemy armor works in another system. So long as you have all 3 of these components, you can make a chance to hit formula for that system.

If you enjoyed what you read be sure to check out my ongoing review for all of the official D&D 5e books!

1. randomstuff53 says:

Thank you for writing this, Its been very helpful to me as a creator, Just wondering if there is a formula for calculating chances to hit at least once within a single turn if there are multiple attacks per turn, I did find a website that can do that for me but I think it would just be fun to knwo

2. Frederik Van der Veken says:

Nice writeup. No game lends itself as good as D&D to get to the basics of statistics. However, you’ve got your math a bit wrong for extreme high/low cases. If I have a +10 on attack vs an AC of 11, I should always hit, except in case of a natural 1. Hence, probability 95%. Your formula gives 100% in that case.

Also, the ability check formula is wrong; it should still be 21 instead of 20. Check it yourself: if the DC is 15 and I have a +2 modifier, I’ll succeed when rolling 13, 14, 15, 16, 17, 18, 19, 20. That is 8 rolls out of 20, hence 40%. Your formula gives 35%.

The difference between 20 and 21 does not represent the usage or not of an automatic hit/miss like you seem to believe. It should always be 21, as this is dictated by statistics (it comes from the fact that a roll equal to AC also hits – if this would not be the case, we would use 20). The use of automatic hit/miss should be implemented differently.

The correct way to deal with this type of probabilities, is to count success configurations (21 – AC/DC + modifier) and divide them over total configurations (20). For attack rolls, you should take into account that you always have minimally 1 success configuration (instead of 0, due to natural 20), and maximally 19 (instead of 20, due to epic fail). This can be done by using min/max:

# of success configurations = min[ max[ (21 – AC + modifier) , 1 ] , 19 ]

Then you should also cap the probability at 0% and 100% (probabilities cannot be negative nor larger than 1). This can also be done with a min/max. You can combine both steps into one:

ability roll probability: min[ max[ (21 – DC + modifier) / 20 *100 , 0 ] , 100 ]
attack roll probability: min[ max[ (21 – AC + modifier) / 20 *100 , 5 ] , 95 ]

You can easily check this yourself by listing all possible roll outcomes for different AC/DC and modifiers (try a few cases: one where the modifier equals the DC/AC, one where it is bigger than the DC/AC, and one where it is smaller than the DC/AC). You’ll come to the same conclusion :-).

Thanks for putting the effort in this!

Cheers

• Eldadres says:

This is fantastic info! I’ll need to take a deeper look at this and make some revisions to the original article. Thank you!