D&D Attack Bonus Calculator

Calculate your D&D 5e attack bonus instantly.
Enter your level, ability modifier, proficiency, and magic weapon bonus to get your total to-hit bonus.

The modifier, not the score. An 18 gives +4, a 16 gives +3, a 20 gives +5.
Total Attack Bonus

Dungeons & Dragons, the original tabletop RPG (Role-Playing Game)

Dungeons & Dragons was created by Gary Gygax and Dave Arneson and published in 1974. The 5th Edition (5e) launched in 2014 and became the most successful version of the game by a wide margin. This calculator uses the 2014 rules; the 2024 revision leaves the attack bonus formula alone, so the arithmetic here holds either way.

Combat in 5e runs on one very simple system, and the attack bonus sits at the heart of it.

How combat resolution works

When you attack in 5e, the basic flow is:

  1. Roll a 20-sided die (d20)
  2. Add your attack bonus
  3. Compare to the target’s Armor Class (AC)
  4. If your total equals or exceeds AC → hit
  5. If below AC → miss
  6. Roll a natural 20: it hits whatever the target’s AC is, and you roll the damage dice twice
  7. Roll a natural 1: it misses whatever your bonus is

The attack bonus is the number added at step 2. Those last two rules are why no attack in 5e is ever a certainty or a lost cause: the range is always 5% to 95%.

The attack bonus formula

Attack bonus = Ability modifier + Proficiency bonus (if proficient) + Magic weapon bonus + Other modifiers

Each component:

Ability modifier:

  • Calculated from your ability score: (Score - 10) ÷ 2, rounded down
  • Score 10-11 = +0; 12-13 = +1; 14-15 = +2; 16-17 = +3; 18-19 = +4; 20 = +5
  • Strength (STR) for melee weapons
  • Dexterity (DEX) for ranged and finesse weapons
  • Spellcasting ability (INT/WIS/CHA) for spell attacks

Proficiency bonus (if proficient with the weapon):

  • Based on character level
  • Levels 1-4: +2
  • Levels 5-8: +3
  • Levels 9-12: +4
  • Levels 13-16: +5
  • Levels 17-20: +6

Magic weapon bonus:

  • +1, +2, or +3 from enchantments
  • Adds to both attack and damage rolls
  • A +1 weapon is uncommon, +2 is rare, +3 is very rare

Other modifiers:

  • Class features (Sneak Attack from Rogue doesn’t add to attack)
  • Spells (Bless: +1d4, Bardic Inspiration: variable)
  • Conditions (frightened: disadvantage)
  • Special weapons (some specific +1 or higher)

Proficiency bonus progression

Proficiency climbs on a fixed staircase, one step every four levels:

Character Level Proficiency Bonus
1-4 +2
5-8 +3
9-12 +4
13-16 +5
17-20 +6

One number covers everything you are trained in. The same bonus goes into attack rolls, saving throws, skill checks and your spell save DC, which is why a level-up feels like a bigger jump than a single +1 should.

Worked example

A 9th-level Ranger using a shortbow:

  • Dexterity 18 → DEX modifier +4
  • Proficient with shortbow → +4 proficiency bonus
  • Wielding a +1 magic shortbow
  • Total attack bonus: +4 + +4 + +1 = +9

To hit AC 15: needs 6 or higher on the d20 → 75% chance to hit To hit AC 20: needs 11 or higher on the d20 → 50% chance to hit To hit AC 25: needs 16 or higher on the d20 → 25% chance to hit

Probability table for any attack bonus

For attack bonus +X attacking AC Y, the chance to hit is:

P(hit) = (21 - (AC - Attack Bonus)) ÷ 20

Attack Bonus vs AC 10 vs AC 15 vs AC 20
+0 55% 30% 5%
+2 65% 40% 15%
+4 75% 50% 25%
+6 85% 60% 35%
+8 95% 70% 45%
+10 95% (cap) 80% 55%
+12 95% (cap) 90% 65%

(95% cap because rolling a 1 always misses. 5% minimum because rolling a 20 always hits.)

Ability score range

D&D 5e character ability scores:

Score Modifier Description
1 -5 Helpless
3 -4 Catastrophically weak
5 -3 Very poor
7 -2 Below average
8-9 -1 Slightly below average
10-11 +0 Average
12-13 +1 Slightly above average
14-15 +2 Good
16-17 +3 Excellent
18-19 +4 Near peak
20 +5 Maximum for most characters
21-29 +5 to +9 Magical enhancement, still (score - 10) ÷ 2
30 +10 Demigod / divine

Standard characters max at 20. Magical effects can push higher (Manual of Bodily Health, etc.).

Common attack types and their abilities

Different weapons and spells use different abilities:

Melee weapons (longsword, axe, dagger):

  • Strength-based by default
  • “Finesse” weapons (rapier, scimitar) can use DEX
  • “Heavy” weapons require STR

Ranged weapons (longbow, shortbow, crossbow):

  • Dexterity-based
  • “Thrown” weapons (handaxe, javelin) use STR (or DEX if finesse)

Spell attacks:

  • Wizard, Artificer, Eldritch Knight, Arcane Trickster: Intelligence
  • Cleric, Druid, Ranger: Wisdom
  • Bard, Sorcerer, Warlock, Paladin: Charisma

Class-specific examples

Fighter (level 5, two-handed sword):

  • STR 18 (+4), Proficient, no magic weapon
  • Attack: +4 STR + +3 Proficiency = +7

Paladin (level 8, longsword and shield):

  • STR 18 (+4), Proficient, +1 longsword
  • Attack: +4 STR + +3 Proficiency + +1 magic = +8

Wizard (level 9, casting fire bolt):

  • INT 18 (+4), spellcasting proficient
  • Attack: +4 INT + +4 Proficiency = +8

Rogue (level 10, hand crossbow with sneak attack):

  • DEX 18 (+4), Proficient
  • Attack: +4 DEX + +4 Proficiency = +8 (plus Sneak Attack damage if conditions met)

Ranger (level 11, longbow with +2 enchantment):

  • DEX 20 (+5), Proficient, +2 magic bow
  • Attack: +5 DEX + +4 Proficiency + +2 magic = +11

Critical hits and misses

Critical hit (natural 20):

  • Hit regardless of bonus or AC
  • Roll damage dice twice
  • Add modifiers once
  • Class features may add to critical (Champion Fighter: 19-20 crit range)

Critical miss (natural 1):

  • Miss regardless of bonus
  • No damage
  • Some homebrew rules add penalties (dropped weapon, a free attack of opportunity for the enemy)
  • Official 5e rules: just a miss

Advantage and disadvantage

D&D 5e’s most important mechanic:

Advantage: roll 2d20, take the higher

  • Sources: prone target (melee), invisible attacker, flanking (variant rule)

Disadvantage: roll 2d20, take the lower

  • Sources: prone target (ranged), heavily obscured, restrained

How much is advantage actually worth? Two numbers get quoted and they measure different things, so here are both. The average of the higher of two d20s is 13.825 against 10.5 for one, a gain of +3.3 on the roll. But what you care about is hit chance, and there the gain depends on the target: it is worth almost nothing when you were hitting on a 2 anyway, and peaks at the equivalent of +5 when you need an 11, right in the middle where most real attacks sit.

That peak is why advantage beats almost any modifier you can stack. Disadvantage is the mirror image and costs the same.

Improving attack bonus

To boost your attack bonus:

  1. Increase relevant ability score: ASIs (Ability Score Increases) at certain levels
  2. Level up: proficiency bonus increases
  3. Find magic weapons: +1, +2, +3
  4. Class features: Fighter’s Action Surge, Paladin’s Smite (separate roll)
  5. Buffs: Bless spell (+1d4), Bardic Inspiration (+1d6 to 1d12)
  6. Hunter’s Mark / Hex: extra damage, not attack
  7. Feats: Sharpshooter (-5/+10), Great Weapon Master (-5/+10)

Common attack bonus mistakes

  1. Forgetting proficiency: rangers using crossbows they’re proficient with shouldn’t drop the bonus
  2. Wrong ability: using STR for a DEX-based weapon
  3. Stacking magic: only one weapon bonus applies
  4. Missing class features: Bardic Inspiration, Bless, etc.
  5. Wrong proficiency at level: proficiency increases each tier
  6. Stacking bonuses incorrectly: typically only one of each type
  7. Forgetting advantage: huge effective bonus
  8. Sharpshooter math: -5 to hit, +10 damage requires careful evaluation

The Sharpshooter question, since everyone asks it

Take the -5 when your hit chance is high enough that losing 25 percentage points of it costs less than the +10 damage buys. The rough line is that it pays while you would still hit on a 9 or better with the penalty applied. Against a heavily armored target it is usually a trap, and against advantage it usually is not.


How we build and check this calculator

This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.

SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.


Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.