Template:Hdsize
From D&D Wiki
Usage
This template returns the size of a creature's Hit Die, based on its size category. E.g., a Tiny creature has a d4 hit die. To use it, type or paste the following:
{{hdsize|Tiny}}
The above example will return "4". Replace small with Small, Medium, Large, Huge, or Gargantuan as appropriate. Be sure to use capitalized size names.