Magnesium hydroxide (Mg(OH)2) has a wide bandgap of about 5.7 eV and is usually considered an insulator. In this study, the energy levels of impurities introduced into Mg(OH)2 are predicted by first-principles calculations. A supercell of brucite Mg(OH)2 consisting of 135 atoms is used for the calculations, and an impurity atom is introduced either at the substitutional site replacing Mg or the interlayer site. The characteristics of impurity levels are predicted from density-of-states analysis for the charge-neutral cell. According to the results, possible shallow donors are trivalent cations at the substitutional site (e.g., Al and Fe) and cation atoms at the interlayer site (Cu, Ag, Na, and K). On the other hand, an interlayer F atom can be a shallow acceptor. Thus, valence control by impurity doping can turn Mg(OH)2 into a wide-gap semiconductor useful for electronics applications.