An attack roll represents your attempt to strike your opponent on your turn in a round. When you make an attack roll, you roll a d20 and add your attack bonus. (Other modifiers may also apply to this roll.) If your result equals or beats the target’s Armor Class, you hit and deal damage.
Automatic Misses and Hits
A natural 1 (the d20 comes up 1) on an attack roll is always a miss. A natural 20 (the d20 comes up 20) is always a hit. A natural 20 is also a threat—a possible critical hit.
Your attack bonus with a melee weapon is:
Base attack bonus + Strength modifier + size modifier
With a ranged weapon, your attack bonus is:
Base attack bonus + Dexterity modifier + size modifier + range penalty
A base attack bonus is an attack roll bonus derived from character class and level or creature type and Hit Dice (or combinations thereof). Base attack bonuses increase at different rates for different character classes and creature types. Base attack bonuses gained from different sources, such as when a character is a multiclass character, stack.
Your Armour Class (AC) represents how hard it is for opponents to land a solid, damaging blow on you. It’s the attack roll result that an opponent needs to achieve to hit you. Your AC is equal to the following:
10 + armour bonus + shield bonus + Dexterity modifier + size modifier
Note that armour limits your Dexterity bonus, so if you’re wearing armour, you might not be able to apply your whole Dexterity bonus to your AC.