Catalyzes the conversion of the nucleoside breakdown products ribose-1-phosphate and deoxyribose-1-phosphate to the corresponding 5-phosphopentoses. Catalyzes the interconversion of glucose-1-phosphate into glucose-6-phosphate but with a lower catalytic efficiency. In vitro, has also a low glucose 1,6-bisphosphate synthase activity which is most probably not physiologically relevant. alpha-D-ribose 1-phosphate = D-ribose 5-phosphate 2-deoxy-alpha-D-ribose 1-phosphate = 2-deoxy-D-ribose 5-phosphate alpha-D-glucose 1-phosphate = alpha-D-glucose 6-phosphate Binds 1 Mg(2+) ion per subunit. Belongs to the phosphohexose mutase family.