What Is an Attack Roll in Dungeons & Dragons
An attack roll determines whether a character successfully hits a target in D&D 5th Edition. It is the core resolution mechanic for melee and ranged combat, spell attacks that require a weapon, and many contest actions. Every attack roll uses a twenty-sided die (d20), to which relevant modifiers are added. The result is compared to a target number — the target’s Armor Class (AC) — to decide if the attack connects. This guide breaks down components, modifiers, special rules, and practical strategies so you can consistently calculate and improve your to-hit chances.
Core Mechanics of the d20 Attack Roll
At its simplest, an attack roll follows this structure: roll a d20, add applicable modifiers, and compare the total to the target’s AC. If the total equals or exceeds AC, the attack hits. The d20 provides the random outcome, while modifiers represent your character’s training, abilities, situational advantages, and magical effects. This straightforward system supports fast play while allowing nuanced decisions. Below is a quick reference for how key factors influence the result:
| Attribute | Verified Detail | Source Type |
|---|---|---|
| Base Die | d20 | Rulebook Standard |
| Primary Modifiers | Proficiency Bonus, Ability Modifier (usually Dexterity for ranged or finesse weapons, Strength for melee) | Character Build |
| Situational Bonuses | Cover, Invisibility, Spells (like Guidance or Bane), class features (e.g., Sharpshooter) | Rules as Intended |
| Penalties | Disadvantage, long range, exhausted condition, restrained | Rules as Intended |
| Target AC Range (typical) | 10 (unarmored) to 30+ (high magic or optimized builds) | Reference |
Calculating Your To-Hit Number
To calculate your to-hit, start with a d20 roll, then add your proficiency bonus (if you’re proficient with the weapon or attack form) and your relevant ability modifier. For example, a 1st-level character using a longsword with Strength 16 (+3) and proficiency in martial weapons (+2) has a +5 to hit. Range and cover modify this number in specific ways. At higher levels, proficiency and ability scores scale, making it essential to track how your bonuses evolve. Magic weapons add their bonus to attack rolls as well, typically as a flat bonus to d20 rolls rather than damage.
Advantage and Disadvantage
When you have advantage, you roll two d20s and take the higher result; with disadvantage, you take the lower. These rules represent favorable or unfavorable conditions, such as half cover behind a wall or being targeted by multiple foes. Advantage increases your chance to hit more than a simple flat bonus, especially at mid to high numbers, because it lowers the chance of rolling a low result on the d20. Disadvantage has a similarly nonlinear impact, making misses more likely.
How Ability Scores and Proficiency Shape Attack Rolls
Your ability scores directly affect attack rolls through modifiers. Strength governs melee attacks that rely on brute force, while Dexterity covers ranged weapons, finesse weapons, and many initiative-based actions. When you use a weapon that lists Strength or Dexterity, use that modifier for the attack roll. Finesse weapons allow you to use Dexterity instead, offering a tactical choice for lightly armored characters. Proficiency reflects formal training; if you’re proficient with your weapon, add your proficiency bonus to the attack roll, increasing consistency as your level rises.
Weapon Categories and Relevant Abilities
- Martial melee weapons (greataxe, longsword): Strength modifier + proficiency
- Finesse melee weapons (rapier, shortsword): Strength or Dexterity modifier + proficiency
- Ranged weapons (longbow, hand crossbow): Dexterity modifier + proficiency
- Spell attacks that use a weapon: spellcasting ability modifier + proficiency
- Improvised attacks: usually only Strength modifier, no proficiency unless the DM allows
Situational Modifiers, Cover, and Environmental Effects
Situational modifiers can make hitting harder or easier. Half cover grants a +2 bonus to AC but typically doesn’t change your attack roll; however, some effects impose penalties on attacks against targets behind cover. Invisibility grants attackers advantage on attack rolls against that creature, while being blinded imposes disadvantage. Range penalties apply when attacking a target more than your weapon’s first range increment, often leading to disadvantage beyond that threshold. Other conditions — such as the restrained condition or attacking in difficult terrain — may impose disadvantage or require checks. Always clarify with your DM how environment and conditions interact with attack rolls.
Common Modifiers Table
| Modifier Type | Verified Detail | Source Type |
|---|---|---|
| Advantage | Roll two d20s, take higher | PHB Rule |
| Disadvantage | Roll two d20s, take lower | PHB Rule |
| Half Cover | +2 AC (no automatic attack roll change) | PHB Rule |
| Threequarters/Full Cover | Total cover; cannot be targeted directly | PHB Rule |
| Invisibility | Attackers have advantage vs the invisible creature | PHB Rule |
| Blinded Condition | Attacker has advantage vs blinded target | PHB Rule |
| Long Range (first/second range) | Typically no penalty, then possible disadvantage depending on weapon | XGtE/Sage Advice |
Special Cases: Spells, Features, and Optional Rules
Certain spells and class features directly modify attack rolls. Bane imposes a d4 penalty to attack rolls, while Guidance provides a d4 bonus — these are added after the d20 roll but before comparing to AC. The Sharpshooter feat lets you take a -5 penalty to gain +10 to damage and ignore cover and half cover for that attack, trading defense for damage. Optional rules like Critical Hits on a natural 18–20 or the Two-Weapon Fighting penalty adjustments can also reshape your strategy. Always confirm with your table which optional rules are in use.
Features That Alter Attack Rolls
- Divine Smite (Paladin): deals extra radiant damage on a hit, doesn’t affect the roll
- Maiden’s Favor (Oath of the Ancients paladin): once per short rest, roll a d4 and add it to one attack roll
- Brutal Critical (Fighter): extra dice on damage rolls on a critical hit, not on the to-hit roll
- Eldritch Smite (Warlock): lets you spend a spell slot to add damage, not to the attack roll
Tactics and Optimization Strategies
Improving your attack roll starts before you roll. Positioning for advantage by flanking or using features that grant advantage can boost your hit chance more reliably than stacking bonuses. Choose weapons that match your ability scores and proficiencies; using a finesse weapon with Dexterity can free up Strength for armor or shields. Track enemy AC and common resistances to avoid wasting high-cost abilities on targets that will shrug them off. At higher levels, consider trade-offs like Sharpshooter for extra damage or feats like Sharpshooter to maintain accuracy while breaking cover. For DMs, vary AC and resistances to keep combat engaging without undermining player agency.
Practical Checklist to Maximize Attack Rolls
- Know your modifiers: ability, proficiency, weapon, and situational
- Check for advantage or disadvantage sources before rolling
- Factor in cover, range, and conditions that impose penalties
- Use class features and spells that improve to-hit when appropriate
- Balance damage-enhancing trade-offs (e.g., Sharpshooter) against your role
Frequently Asked Questions
Below are concise answers to common questions about attack rolls in D&D 5e.
Can you add your ability modifier to an attack roll more than once? No, you add each modifier only once per attack roll, unless a feature explicitly allows it (e.g., certain magic items or class features).
Does natural 20 always hit? Yes, a natural 20 on the d20 is a hit, regardless of target AC, unless the DM’s ruling or a specific feature states otherwise.
Does natural 1 always miss? Typically yes, a natural 1 is an automatic miss, though DMs may adjust this for special cases.
What happens if my attack roll ties with AC? A tie equals a hit; the attack successfully connects.
Do spells that require attack rolls add spellcasting ability or another modifier? It depends on the spell; some spell attacks use spellcasting ability, others use Dexterity or another attribute. Read each spell’s description.
Can advantage stack with a bonus from a feature like Sharpshooter? Yes, advantage and a numerical bonus are separate and both apply to the total roll.