# Armor class
In Dungeons and Dragons, your armor class, or AC, represents your defense against attacks from monsters. NetHack borrows this concept; as in older editions of D&amp;D, a lower AC is better than a higher one. A character with no armor or protection has AC 10. It is best to reduce your AC below 0. An ascension kit usually includes an AC below -20, -30, and sometimes -40. A good AC is not enough to protect from some attacks; you also need to obtain resistances. In particular, reflection is a good idea.
Because you always know your AC, you can identify the enchantment of armor by wearing it. For example, +1 armor lowers your AC by one more than normal.

Contents

1 How it works

1.1 Damage reduction
1.2 Integer overflow

2 How much is enough?
3 Best realistically possible armor class
4 SLASH'EM
5 Encyclopedia entry
6 See also
7 References

How it works
When a monster attacks you, 1d20 is rolled. Rolling lower than a target number results in a hit. In simple situations at low levels, this target number is equal to:[1][2][3]
10 + AC + the monster's level (i.e., the number of hit dice they have).
So, say your AC is 6, and you are fighting a level 1 goblin. The target number for the goblin to successfully attack you is 10 + 6 + 1 = 17. This is bad news; the goblin is going to hit you 80% of the time.
At higher levels and in funny circumstances, things become more complex. The precise details are:

If your AC is negative, the formula for the target number is 10 + (a random number from -1 to your AC) + the monster's level.
If the monster can't see you or is trapped, subtract 2 for each.
If you are paralyzed or similar, add 4.
If the final target number is so good that it would be less than or equal to zero, set it to 1. Note that a value of 1 is still unhittable, since it must roll under the target number.
If the monster is using a weapon, it may get a to-hit bonus or penalty from that weapon. This is the only hit modification that is applied after the above setting of a too-low target number to 1.
If the monster gets multiple attacks, each attack beyond the first is made as if the die rolled had an extra side. So a monster with three attacks would roll 1d20, then 1d21, then 1d22. In this way each extra attack is less and less likely to hit you.
Examples of these more complex cases:

Your AC is -5. Since it is a negative number, a number between -5 and -1 is chosen at random. In this case, it is -3. 10 is added to that, giving 7. The monster has a level of 4, and it has two attacks. Added together, that gives us 11. On the first attack, the random number chosen is 10. The monster hits. On the second attack, the random number chosen is 12 (out of a possible 21). The monster misses.
Your AC is -20. A number between -20 and -1 is chosen at random. In this case, -17 is chosen. 10 is added to that, giving -7. The monster has a level of 1. Added together, that gives -6. Since -6 is less than 0, it is set to 1. On the first attack, the random number chosen is 1. The monster misses, with a special attack message (it "just misses", rather than "misses").
Your AC is -20. A number between -20 and -1 is chosen at random. In this case, -4 is chosen. 10 is added to that, giving 6. The monster has a level of 1. Added together, that gives 7. On the first attack, the random number chosen is 5. 7 is greater than 5, so the monster hits.
Damage reduction
Any AC of negative value (-1 or lower) also decreases the damage you take.[4]
Let's take a look at example 3 and see how a lower AC would reduce damage. The monster does 5 points of damage when it hits.
First, it determines if your AC is less than 0; in this case it is. The damage is then reduced by a random number between 1 and the absolute value of your AC, which in this case would be 1 to 20. For any value lower than 1, it is set to 1 (the monster will always do at least 1 point of damage when it hits). (This is applied before half physical damage, if you have that as well.) 
This is another good reason to reduce your AC as low as you can get it.

Integer overflow
The lowest possible AC is -128, it would be fixed at that value even when your combined monster AC, intrinsic protection and armor could have made it lower. In 3.4.3, positive AC behaved differently from negative AC: it will wrap around from 127 to -128. (This is possible by eating lots of negatively enchanted rings of protection.)[5] In 3.6.0, this bug was fixed, so if the AC should be higher than 127, it becomes 127.[6]

How much is enough?
The data for the following table comes from 500,000 simulated minotaur attacks (claw 3d10, claw 3d10, butt 2d8). Minotaurs appear often in the later game, hit hard, and ignore Elbereth, making them the biggest physical damage threat in the late game and a natural choice of benchmark.
The percentage entries indicate how likely you are to take less than a certain amount of damage. For example, if your armor class is -15, 50% of the time a minotaur's three attacks will do less than 16 damage total. And if your armor class is -25, you will take no damage 25% of the time.

Armor class

Mean damage per round

25% less than

50% less than

95% less than

99% less than

-10

23.1

17

24

40

47

-15

16

9

16

35

42

-20

11

3

11

30

37

-25

7.5

1

5

26

34

-30

5.4

1

3

23

31

In the notes for the MIT NetHack course, Raxvulpine recommends AC -20 as the baseline for an ascension kit. This is a reasonable guideline; with smart play, 11 damage per enemy turn is manageable.
Two things should be noted. First, the effect of an additional point of AC gets lower the lower it already is. Second, due to the nature of the attack and damage calculations, no amount of armor class can protect you with 100% certainty. Even if your armor class is -30, one time in a hundred a minotaur will hit you for at least 31 damage in one round.

The following table shows the mean damage some deadly monsters inflict at various armor classes.  The damage is per turn of a normal speed player, so the chart shows the cumulative damage of 1.8 bites from a giant bat, or 3 pummels from an air elemental.  Poison damage is ignored.  The air elemental damage assumes a 100% hit rate (i.e., that the elemental has already engulfed the player).  

Mean Damage Taken Per Turn of a Normal Speed Adventurer

AC

Jackal

Giant Bat

Rothe

Jaguar

Soldier Ant vs Pois Resistant

Unicorn

Leocrotta

Air Elemental (Engulfing)

Minotaur

10

1.4

6.4

6.4

11.9

18.8

20.0

31.5

16.5

52.5

9

1.4

6.4

6.4

11.9

18.8

20.0

31.5

16.5

52.5

8

1.3

6.1

6.4

11.6

18.2

20.0

31.5

16.5

52.5

7

1.2

5.8

6.2

11.2

17.3

19.7

31.5

16.5

52.5

6

1.1

5.5

6.0

10.7

16.4

18.7

31.0

16.5

52.5

5

1.0

5.1

5.7

10.1

15.5

17.7

30.0

16.5

52.5

4

1.0

4.8

5.4

9.5

14.6

16.7

28.5

16.5

52.5

3

0.9

4.5

5.1

9.0

13.7

15.7

27.0

16.5

52.5

2

0.8

4.2

4.8

8.4

12.8

14.8

25.5

16.5

52.5

1

0.8

3.9

4.5

7.9

11.8

13.8

24.0

16.5

52.5

0

0.7

3.5

4.2

7.3

10.9

12.8

22.5

16.5

52.5

-1

0.4

2.4

2.9

6.3

8.4

9.7

18.0

13.8

48.8

-2

0.4

2.0

2.5

6.5

7.3

8.5

16.0

12.6

46.9

-3

0.3

1.7

2.2

5.4

6.3

7.4

14.1

11.5

44.9

-4

0.3

1.4

1.9

4.6

5.4

6.5

12.4

10.5

42.7

-5

0.3

1.2

1.7

3.9

4.6

5.7

10.8

9.6

40.3

-6

0.3

1.1

1.6

3.4

3.9

5.0

9.4

8.8

37.9

-7

0.3

0.9

1.4

3.0

3.4

4.4

8.3

8.1

35.5

-8

0.2

0.8

1.3

2.6

2.9

3.9

7.3

7.5

33.2

-9

0.2

0.8

1.2

2.4

2.5

3.5

6.4

7.0

31.0

-10

0.2

0.7

1.1

2.1

2.2

3.1

5.7

6.6

28.9

-15

0.1

0.4

0.8

1.3

1.2

1.8

3.3

5.4

20.0

-20

0.1

0.3

0.5

0.9

0.8

1.2

2.1

4.8

13.7

-25

0.1

0.2

0.4

0.7

0.6

0.9

1.5

4.4

9.4

-30

0.1

0.2

0.4

0.6

0.5

0.7

1.2

4.2

6.8

-35

0.1

0.2

0.3

0.5

0.4

0.6

1.0

4.0

5.2

-40

0.0

0.1

0.3

0.4

0.3

0.5

0.8

3.9

4.1

Note that an armor class of 0 is often insufficient to safely melee some monsters with a difficulty of 6, like jaguars, unicorns, and soldier ants.  An armor class of -10 can make most of the early/mid game monsters safe to melee.
The above table does not include all of the monsters that are dangerous to melee in the early game.  In particular, dwarves wielding mattocks, mimics, and mumaks can deal considerable damage on each of their turns.  These monsters are slower than a typical player, however, and mean damage per player turn could be misleading.

Best realistically possible armor class
There is no limit to how much intrinsic protection you can have, but donating to priests will rarely grant more than nine points.  Further protection can be granted by rings of protection or prayer, or temporarily by the protection spell.  Many polymorphed forms have base armor class better than 10.  Assuming nine points protection, seven piece armor with each piece the best possible for its type, and each piece enchanted to +5 (elven pieces to +7), one's armor class would be:

Armor piece
Protection
With enchantment

Any dragon scale mail
9
14

Cloak of protection
3
8

Elven leather helm
1
8

Elven shield
2
9

Elven boots
1
8

Gloves, any type
1
6

Hawaiian shirt or T-shirt
0
5

totaling 9 + (14 + 8 + 8 + 9 + 8 + 6 + 5) = 67 points, for an armor class of -57. However, it would be rare for a player to use this equipment: many characters would rather twoweapon than wear a shield; some players prefer a shield of reflection; jumping boots or speed boots are usually preferable to elven boots if available; a helm of brilliance is usually better than an elven leather helm; and a cloak of magic resistance, cloak of displacement, or robe may be more useful than a cloak of protection. An armor class of -57 is also overkill for any ordinary game, so most players would rather use their magic marker charges on something more useful than excessive scrolls of enchant armor.

SLASH'EM
Dexterity has an impact on AC.

Dexterity

AC

3&lt;
+3

4-5
+2

6-7
+1

8-14
0

15
-1

16
-2

17
-3

18
-4

19
-5

20-21
-6

22-23
-7

24&gt;
-8

Doppelgangers and Monks have complicated special bonuses. Doppelgangers get the bonus for not wearing any armor, and Monks get the bonus for no shield, no wielded weapon, and no body armor (cloaks and robes are allowed).

Encyclopedia entry
See the encyclopedia entry for armor.
See also
Ascension kit
References

↑ Source:NetHack_3.6.0/src/mhitu.c#line496

↑ Source:NetHack_3.6.0/src/mhitu.c#line607

↑ Source:NetHack_3.6.0/include/hack.h#line407

↑ Source:NetHack_3.6.0/src/mhitu.c#hitmu

↑ do_wear.c in NetHack 3.4.3, line 1612

↑ Source:NetHack_3.6.0/src/do_wear.c#line1992

This page may need to be updated for the current version of NetHack.
It may contain text specific to NetHack 3.6.0. Information on this page may be out of date.
Editors: After reviewing this page and making necessary edits, please change the {{nethack-360}} tag to the current version's tag or {{noversion}} as appropriate.