How to Calculate an Attack Bonus in D&D 5e (With Examples)


Few things in Dungeons & Dragons 5e feel as dramatic as lifting your sword, drawing your bow, or pointing one suspiciously glowing finger at a goblin and asking the most important question in tabletop history: “Do I hit?” That tiny moment depends on your attack bonus, the number you add to a d20 roll when you make an attack. It is simple once you understand it, but D&D character sheets can make it look like a math goblin moved into your pencil case.

The good news: calculating an attack bonus in D&D 5e usually comes down to one clean formula. You take the right ability modifier, add your proficiency bonus if you are proficient, then include any special bonuses from magic items, class features, spells, or other effects. That final number is your “to-hit” bonus, the modifier added to your attack roll against a target’s Armor Class, also called AC.

This guide explains how to calculate weapon attack bonuses, spell attack bonuses, melee attacks, ranged attacks, finesse weapons, thrown weapons, and common bonus modifiers. We will also walk through practical examples so you can stop staring at your character sheet like it just cast confusion.

What Is an Attack Bonus in D&D 5e?

An attack bonus in D&D 5e is the number you add to your d20 roll when your character makes an attack roll. If your result equals or exceeds the target’s Armor Class, the attack hits. If it is lower, the attack misses, and the monster gets to keep being smug for another six seconds.

The basic attack roll looks like this:

For example, if your fighter has a +5 attack bonus with a longsword and rolls a 12 on the d20, the total attack roll is 17. If the target has AC 15, the fighter hits. If the target has AC 18, the fighter misses unless some other effect changes the result.

Your attack bonus is not your damage bonus. This is one of the biggest beginner mistakes. The attack bonus helps determine whether you hit. Damage is rolled afterward and follows its own rules. Think of attack bonus as “Can I bonk?” and damage as “How much bonk happened?” Very scientific. Wizards are still studying it.

The Basic Formula for Attack Bonus in D&D 5e

For most weapon attacks, the formula is:

You only add your proficiency bonus if you are proficient with the weapon you are using. You also add other bonuses only when a feature, spell, magic item, or rule specifically says they apply.

Step 1: Find the Correct Ability Modifier

Most attacks use either Strength or Dexterity. The correct ability depends on the kind of attack you are making.

  • Melee weapon attacks usually use Strength.
  • Ranged weapon attacks usually use Dexterity.
  • Finesse weapons let you choose Strength or Dexterity.
  • Spell attacks use your spellcasting ability modifier, such as Intelligence, Wisdom, or Charisma.

Ability modifiers come from ability scores. A score of 10 or 11 gives a +0 modifier, 12 or 13 gives +1, 14 or 15 gives +2, 16 or 17 gives +3, 18 or 19 gives +4, and 20 gives +5. A quick way to calculate an ability modifier is to subtract 10 from the ability score, divide by 2, and round down.

For example, a Strength score of 16 gives a +3 Strength modifier. A Dexterity score of 18 gives a +4 Dexterity modifier. A Charisma score of 15 gives a +2 Charisma modifier. This number is the backbone of many D&D rolls, including attack rolls, saving throws, and ability checks.

Step 2: Add Proficiency Bonus If It Applies

Your proficiency bonus represents your character’s general training and experience. In D&D 5e, it increases by character level, not by class alone. That means a multiclass character still uses total character level to determine proficiency bonus.

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

You add proficiency bonus to a weapon attack only if your character is proficient with that weapon. A fighter using a longsword is probably proficient. A wizard grabbing a longbow because “it looks cool” may not be. D&D respects fashion, but it does not always reward it mechanically.

Step 3: Add Other Bonuses

After ability modifier and proficiency bonus, add any special bonuses that apply. Common examples include:

  • Magic weapons: A +1 longsword usually adds +1 to attack rolls and damage rolls made with it.
  • Archery Fighting Style: This adds +2 to attack rolls made with ranged weapons.
  • Bless: This spell can add 1d4 to an attack roll.
  • Class features: Some subclasses and abilities add situational bonuses.
  • Cover and conditions: These may affect the target’s AC or your roll, even if they do not directly change your listed attack bonus.

Not every bonus changes the number written beside your weapon on your character sheet. For example, advantage and disadvantage do not add a flat number. They change how many d20s you roll. With advantage, roll two d20s and use the higher result. With disadvantage, roll two d20s and use the lower result. Same attack bonus, different dice drama.

How to Calculate a Melee Weapon Attack Bonus

A melee weapon attack usually uses Strength. This includes attacks with weapons like longswords, greataxes, clubs, maces, spears, and warhammers. If your character is proficient with the weapon, add proficiency bonus.

The formula is:

Example: Level 1 Fighter With a Longsword

Suppose you have a level 1 fighter with Strength 16. A Strength score of 16 gives a +3 modifier. At level 1, your proficiency bonus is +2. Fighters are proficient with longswords.

Your longsword attack bonus is +5. If you roll a 10 on the d20, your total attack roll is 15. Against AC 15, that hits. Against AC 16, it misses. The difference between heroism and embarrassment is sometimes one tiny number.

How to Calculate a Ranged Weapon Attack Bonus

A ranged weapon attack usually uses Dexterity. This includes attacks with bows, crossbows, slings, and many other ranged weapons. If your character is proficient with the ranged weapon, add proficiency bonus.

The formula is:

Example: Level 5 Ranger With a Longbow

Now imagine a level 5 ranger with Dexterity 18. Dexterity 18 gives a +4 modifier. At level 5, proficiency bonus is +3. Rangers are proficient with longbows. If this ranger also has the Archery Fighting Style, add +2 to attack rolls with ranged weapons.

The ranger’s longbow attack bonus is +9. If the ranger also has a +1 longbow, the attack bonus becomes +10. At that point, goblins may begin filing formal complaints with the Dungeon Master.

How Finesse Weapons Work

Finesse weapons are special because they let you choose either Strength or Dexterity for attack and damage rolls. Common finesse weapons include rapiers, daggers, shortswords, and scimitars.

The important rule is that you must use the same ability modifier for both the attack roll and the damage roll. You cannot use Dexterity to hit and Strength for damage unless a special feature says otherwise.

Example: Level 5 Rogue With a Rapier

A level 5 rogue has Dexterity 18 and Strength 10. The rogue attacks with a rapier, which has the finesse property. Since Dexterity is much better than Strength, the rogue chooses Dexterity. At level 5, proficiency bonus is +3.

The rogue’s rapier attack bonus is +7. If Sneak Attack applies, that affects damage, not the attack bonus. Sneak Attack is wonderful, dramatic, and occasionally responsible for the DM sighing deeply, but it does not make the d20 roll more accurate.

How Thrown Weapon Attack Bonuses Work

Thrown weapons can confuse players because they involve distance but are not always treated like standard ranged weapons for ability modifiers. A thrown melee weapon usually uses the same ability modifier it would use for a melee attack. For example, a handaxe usually uses Strength when thrown. A dagger has both finesse and thrown, so you can use Strength or Dexterity.

Example: Level 2 Rogue Throwing a Dagger

A level 2 rogue has Dexterity 16, giving a +3 modifier. The rogue is proficient with daggers, and the level 2 proficiency bonus is +2. Since a dagger has finesse, the rogue can use Dexterity even when throwing it.

The thrown dagger attack bonus is +5. The dagger still has its listed range, and attacking beyond normal range may impose disadvantage. Again, disadvantage does not lower the written attack bonus; it changes the dice you roll.

How to Calculate a Spell Attack Bonus

A spell attack bonus is used when a spell tells you to make a melee spell attack or ranged spell attack. Examples include spells such as fire bolt, guiding bolt, ray of frost, and inflict wounds.

The formula is:

Your spellcasting ability depends on your class. Wizards use Intelligence. Clerics and druids use Wisdom. Bards, paladins, sorcerers, and warlocks use Charisma. Some subclasses and features may use different abilities, so always check the class feature that gives you the spell.

Example: Level 3 Wizard Casting Fire Bolt

A level 3 wizard has Intelligence 16, which gives a +3 modifier. At level 3, proficiency bonus is +2.

The wizard’s spell attack bonus is +5. If the wizard casts fire bolt and rolls a 13, the total attack roll is 18. If the target’s AC is 18 or lower, the spell hits.

Example: Level 9 Cleric Casting Guiding Bolt

A level 9 cleric has Wisdom 18, which gives a +4 modifier. At level 9, proficiency bonus is +4.

The cleric’s spell attack bonus is +8. This bonus applies to spell attacks, not to every spell. If a spell forces a saving throw instead, the target rolls against your spell save DC. That is a different number, calculated with 8 plus your proficiency bonus plus your spellcasting ability modifier.

Attack Bonus vs. Damage Bonus

Attack bonus and damage bonus are related, but they are not the same. Your attack bonus helps you hit. Your damage bonus helps determine how much damage you deal after you hit.

For many weapon attacks, you add the same ability modifier to damage that you used for the attack roll. A fighter with Strength 16 attacking with a longsword might have +5 to hit, but on damage, the fighter usually rolls the weapon’s damage die and adds +3 Strength modifier. The +2 proficiency bonus helped the fighter hit, but it usually does not add to damage.

There are exceptions. A magic weapon may add its bonus to both attack and damage rolls. Some features, fighting styles, and spells may also modify damage. But as a default rule, proficiency bonus helps the attack roll, not the damage roll.

Common Attack Bonus Mistakes

Adding Proficiency When You Are Not Proficient

If your character is not proficient with a weapon, do not add proficiency bonus to attacks with it. You can still attack, but the bonus is smaller. For example, a level 4 wizard with Dexterity 14 using a longbow without proficiency would add only +2 from Dexterity, not +4 total from Dexterity and proficiency.

Adding Proficiency Twice

Do not add proficiency bonus twice to the same attack roll unless a very specific rule says to do something unusual. Expertise is for ability checks, not normal weapon attack rolls. Your rogue may be elegant, mysterious, and capable of stealing everyone’s snacks, but that does not mean the rapier gets double proficiency.

Using Strength for Every Weapon

Not every weapon uses Strength. Ranged weapons usually use Dexterity. Finesse weapons allow a choice. Spell attacks use spellcasting ability. When in doubt, check the weapon property or spell description before writing the attack bonus on your sheet.

Confusing Spell Attack Bonus With Spell Save DC

Your spell attack bonus is used when you roll to hit with a spell. Your spell save DC is used when the target rolls a saving throw against your spell. If the spell says “make a ranged spell attack,” use spell attack bonus. If it says the target must make a Dexterity saving throw, use spell save DC.

Forgetting Situational Effects

Some situations affect attack rolls without changing the permanent number on your sheet. Attacking a target you cannot see may impose disadvantage. Making a ranged attack while a hostile creature is within 5 feet of you may also impose disadvantage. A target behind cover may effectively be harder to hit. These details matter, especially when the party’s plan is held together by confidence, rope, and one nervous bard.

Quick Attack Bonus Cheat Sheet

Attack Type Ability Modifier Add Proficiency? Example
Melee weapon attack Usually Strength Yes, if proficient Longsword, mace, greataxe
Ranged weapon attack Usually Dexterity Yes, if proficient Longbow, shortbow, crossbow
Finesse weapon attack Strength or Dexterity Yes, if proficient Rapier, dagger, shortsword
Thrown melee weapon attack Usually its normal melee ability Yes, if proficient Handaxe, javelin, dagger
Spell attack Spellcasting ability Usually yes Fire bolt, guiding bolt

More Examples of Attack Bonus Calculations

Example 1: Level 1 Barbarian With a Greataxe

A level 1 barbarian has Strength 17, which gives a +3 modifier. The barbarian is proficient with martial weapons, including the greataxe. At level 1, proficiency bonus is +2.

The greataxe attack bonus is +5.

Example 2: Level 8 Fighter With a +1 Longsword

A level 8 fighter has Strength 18, giving a +4 modifier. At level 8, proficiency bonus is +3. The fighter is proficient with longswords, and the weapon is magical with a +1 bonus.

The fighter’s +1 longsword attack bonus is +8.

Example 3: Level 11 Warlock Using Eldritch Blast

A level 11 warlock has Charisma 20, giving a +5 modifier. At level 11, proficiency bonus is +4. Since eldritch blast uses a ranged spell attack, the warlock uses Charisma.

The warlock’s spell attack bonus is +9. Any invocation that changes damage, such as adding Charisma to damage, does not automatically change the attack bonus unless it specifically says so.

Example 4: Level 6 Monk With a Shortsword

A level 6 monk has Dexterity 18, giving a +4 modifier. At level 6, proficiency bonus is +3. A shortsword has finesse, and the monk is proficient, so Dexterity is a strong choice.

The monk’s shortsword attack bonus is +7.

How to Write Attack Bonus on Your Character Sheet

On most D&D 5e character sheets, weapons and spells have a space for an attack bonus. For each weapon or attack spell, write the final bonus you add to the d20. Do not write the whole formula every time unless it helps you remember.

For example, if your level 1 fighter has a longsword attack bonus of +5, write “+5” in the attack bonus box beside longsword. If your wizard has a spell attack bonus of +5, write “+5” in the spell attack section. You can keep a note nearby showing how you got that number, especially if you are new or if your character has many situational bonuses.

Whenever your level changes, your ability scores improve, you gain a magic weapon, or you pick up a new fighting style, check your attack bonuses again. Characters grow. Numbers grow. The goblins remain concerned.

Conclusion

Calculating an attack bonus in D&D 5e is easier than it first appears. Start with the correct ability modifier, add proficiency bonus when your character is proficient with the weapon or when making a spell attack, then add any special bonuses from features, magic items, or spells. For melee weapons, think Strength. For ranged weapons, think Dexterity. For finesse weapons, choose Strength or Dexterity. For spells, use your class’s spellcasting ability.

The key is to separate the attack roll from the damage roll. Your attack bonus answers the question “Do I hit?” Damage answers “What happens after the hit?” Once that difference clicks, your character sheet becomes much less intimidating. It may still have tiny boxes, mysterious abbreviations, and coffee stains from last session, but at least the math will behave.

Player Experience: What Attack Bonuses Feel Like at the Table

In actual play, attack bonuses matter most because they shape how confident a character feels in combat. A level 1 fighter with a +5 to hit often feels reliable against early-game enemies, while a wizard swinging a non-proficient weapon may quickly discover that “I hit it with a sword” is more of a lifestyle choice than a strategy. Players often understand the rule best after watching two characters attack the same monster with very different bonuses.

One common table experience is the “why is your number higher than mine?” moment. A ranger might have a longbow attack bonus of +9 at level 5 because Dexterity, proficiency, and Archery Fighting Style all stack cleanly. Meanwhile, a cleric using a mace with lower Strength may have a smaller weapon attack bonus but a much better spell attack bonus from Wisdom. Neither character is wrong. They are simply built for different jobs. The ranger turns distant enemies into pincushions. The cleric turns poor decisions into radiant consequences.

Another useful experience is learning that a bigger attack bonus does not guarantee success. A natural 1 still misses, and disadvantage can make a strong bonus feel shaky. This is why positioning matters. A ranged character who stands too close to an enemy may roll with disadvantage, even with a great attack bonus. A rogue who hides well or gains advantage from an ally’s tactic may land hits more often than the raw number suggests. D&D combat is not just math; it is math wearing a cloak and making dramatic eye contact.

New players also tend to forget when their proficiency bonus increases. Level 5 is a major checkpoint because proficiency rises from +2 to +3, and many martial characters also gain Extra Attack around that stage. Suddenly, the character feels sharper and more consistent. That one-point increase may look small, but over many rolls it matters. The same thing happens again at levels 9, 13, and 17. Updating the character sheet after leveling is not glamorous, but it prevents the tragic fate of underpowered arithmetic.

As a practical habit, it helps to write attack bonuses in a simple note format: “Rapier +7 = Dex +4, prof +3.” This makes it easy to check your math later. It also helps the Dungeon Master answer questions quickly. Nobody wants a ten-minute debate in the middle of a boss fight because someone forgot whether a dagger can use Dexterity. Spoiler: it can, thanks to finesse.

At the table, attack bonus math becomes second nature after a few sessions. At first, players may ask, “What do I add?” every round. Soon, they are rolling with confidence, announcing totals, and developing highly personal relationships with specific dice. That is the real magic of D&D 5e: the numbers support the story until the moment your d20 betrays you in front of everyone. Then it becomes comedy.

SEO Tags