# Monster level
Monster level is the experience level of a monster. It is used in the calculation of a monster's hit points and experience point value, and in determining whether or not a monster's attack hits you.
If the monster is a spellcaster, then a higher level means a larger spell repertoire, usually containing more dangerous spells. Also, your pet uses monster level to decide whether or not to attack another monster.
The number of hit points of most monsters is (monster level)d8; because of that, monster level is also known as hit dice, a term from Dungeons and Dragons. This is the meaning of "HD", which appears in the bottom status line when you are polymorphed into a monster.

Contents

1 Calculation of monster level
2 Exceptions
3 Monster level and hit points
4 References

Calculation of monster level
Each monster has a base level, which can be found in the information box on the monster's page. However, not every monster will be generated at its base level; monster level is influenced by level depth and the hero's experience level.
Specifically, when a monster is generated, its level is determined as follows:[1]

Start with the monster's base level;
If the level depth value is smaller than the monster's base level, subtract one;
If the level depth value is bigger than the monster's base level, add one-fifth of the difference between the two (rounded down);
If your experience level is higher than the monster's base level, add one-fourth of the difference between the two (rounded down);
If the result is higher than 1.5 times the monster's base level (rounded down), then it is lowered to that number;
If the result is higher than 49, then it is lowered to that number.
The final result is the monster's starting level.
If you are in the Endgame, then your effective level depth is the depth of the Sanctum plus one half of your experience level. If you have the Amulet of Yendor but are not in the Endgame, then your effective level depth is the depth of the Sanctum.
There are a few ways for a monster to gain levels. For more information about this, see Growing up.

Exceptions
The Wizard of Yendor is an exception to these rules. His level is 30, plus the number of times he has been killed, up to a maximum of 49.[2]
Player monsters that are generated when you arrive on the Astral Plane or the final level of the Wizard quest are another exception. They are generated at a random level, between 15 and 30 for the Astral Plane, and between 1 and 16 for the Wizard quest.[3]
Similarly, your guardian angel on the Astral Plane is generated at a random level, between 15 and 22.[4]
Named demons and the mail daemon (which are internally defined with "monster level" greater than 49) are another exception. They have a fixed starting number of hit points, and their starting level is one-fourth of that number (rounded down):[5]

Monster
Starting hit points
Starting level

Mail daemon
100
25

Juiblex
88
22

Yeenoghu
100
25

Orcus
120
30

Geryon
132
33

Dispater
144
36

Baalzebub
166
41

Asmodeus
198
49

Demogorgon
200
50

Another exception is self-polymorph. When you polymorph into a monster, your hit dice (HD) will be equal to the monster's base level, without adjustment for dungeon depth or your natural form's level.[6]

Monster level and hit points
The number of hit points of most monsters is (monster level)d8.[7] Exceptions are golems, the Riders, the named demons, adult dragons, elementals created on their home planes, level 0 monsters, player monsters generated when you arrive on the Astral Plane or Wizard quest[8], and your guardian angel on the Astral Plane.[9] For more details, see the hit points article.
When you are polymorphed into a monster, your monster form's hit points are (HD)d8. Exceptions to this are golems, adult dragons, elementals (if you polymorph into one on its home plane), and HD:0 monsters.[10]
References

↑ src/makemon.c in NetHack 3.6.6, line 1755

↑ src/makemon.c in NetHack 3.6.6, line 1762

↑ src/mplayer.c in NetHack 3.6.6, line 142

↑ src/minion.c in NetHack 3.6.6, line 501

↑ src/makemon.c in NetHack 3.6.6, line 995

↑ src/polyself.c in NetHack 3.6.6, line 701

↑ src/makemon.c in NetHack 3.6.6, line 980

↑ src/mplayer.c in NetHack 3.6.6, line 143

↑ src/minion.c in NetHack 3.6.6, line 502

↑ src/polyself.c in NetHack 3.6.6, line 702-L714