Converts guanine to guanosine monophosphate, and hypoxanthine to inosine monophosphate. Transfers the 5-phosphoribosyl group from 5-phosphoribosylpyrophosphate onto the purine. Plays a central role in the generation of purine nucleotides through the purine salvage pathway (By similarity). diphosphate + IMP = 5-phospho-alpha-D-ribose 1-diphosphate + hypoxanthine diphosphate + GMP = 5-phospho-alpha-D-ribose 1-diphosphate + guanine Binds 2 magnesium ions per subunit. The magnesium ions are essentially bound to the substrate and have few direct interactions with the protein. When guanine is used as the substrate, the rate of nucleotide formation is 50% that with hypoxanthine as the substrate. Purine metabolism; IMP biosynthesis via salvage pathway; IMP from hypoxanthine: step 1/1. Belongs to the purine/pyrimidine phosphoribosyltransferase family.