Catalyzes the reversible interconversion of glucose 1-phosphate and glucose 6-phosphate. Key enzyme in hexose metabolism. The reverse reaction is an essential step for biosynthesis because glucose 1-phosphate is the starting point for the synthesis of UDP-glucose, which acts as a precursor for the synthesis of oligosaccharides and trehalose. alpha-D-glucose 1-phosphate = alpha-D-glucose 6-phosphate Binds 1 Mg(2+) ion per subunit. Belongs to the phosphohexose mutase family.