Bifunctional enzyme localized in the lumen of the endoplasmic reticulum that catalyzes the first two steps of the oxidative branch of the pentose phosphate pathway/shunt, an alternative to glycolysis and a major source of reducing power and metabolic intermediates for biosynthetic processes (PubMed:4169027, PubMed:12831846, PubMed:16356929, PubMed:18222920). Has a hexose-6-phosphate dehydrogenase activity, with broad substrate specificity compared to glucose-6-phosphate 1-dehydrogenase/G6PD, and catalyzes the first step of the pentose phosphate pathway (PubMed:4169027, PubMed:12831846, PubMed:18222920). In addition, acts as a 6-phosphogluconolactonase and catalyzes the second step of the pentose phosphate pathway (PubMed:12831846). May have a dehydrogenase activity for alternative substrates including glucosamine 6-phosphate and glucose 6-sulfate (PubMed:12831846). The main function of this enzyme is to provide reducing equivalents such as NADPH to maintain the adequate levels of reductive cofactors in the oxidizing environment of the endoplasmic reticulum (PubMed:12831846, PubMed:16356929, PubMed:17656460, PubMed:18222920). By producing NADPH that is needed by reductases of the lumen of the endoplasmic reticulum like corticosteroid 11-beta-dehydrogenase isozyme 1/HSD11B1, indirectly regulates their activity (PubMed:16356929). D-glucose 6-phosphate + NAD(+) = 6-phospho-D-glucono-1,5-lactone + H(+) + NADH D-glucose 6-phosphate + NADP(+) = 6-phospho-D-glucono-1,5-lactone + H(+) + NADPH 6-phospho-D-glucono-1,5-lactone + H2O = 6-phospho-D-gluconate + H(+) 2-deoxy-D-glucose 6-phosphate + NAD(+) = 2-deoxy-6-phospho-D-glucono-1,5-lactone + H(+) + NADH 2-deoxy-D-glucose 6-phosphate + NADP(+) = 2-deoxy-6-phospho-D-glucono-1,5-lactone + H(+) + NADPH D-galactose 6-phosphate + NADP(+) = 6-phospho-D-galactono-1,5-lactone + H(+) + NADPH D-galactose 6-phosphate + NAD(+) = 6-phospho-D-galactono-1,5-lactone + H(+) + NADH D-glucosamine 6-phosphate + NADP(+) = 2-amino-2-deoxy-6-phospho-D-glucono-1,5-lactone + 2 H(+) + NADPH D-glucose + NAD(+) = D-glucono-1,5-lactone + H(+) + NADH D-glucose + NADP(+) = D-glucono-1,5-lactone + H(+) + NADPH D-glucose 6-sulfate + NADP(+) = 6-sulfo-D-glucono-1,5-lactone + H(+) + NADPH Optimum pH is 6.0-8.0. Carbohydrate degradation; pentose phosphate pathway; D-ribulose 5-phosphate from D-glucose 6-phosphate (oxidative stage). Carbohydrate degradation; pentose phosphate pathway; D-ribulose 5-phosphate from D-glucose 6-phosphate (oxidative stage): step 2/3. Homodimer. Expressed in liver (at protein level) (PubMed:4169027). Expressed in muscles (PubMed:18222920). Expressed in adipose tissues (PubMed:18218694). Mice lacking H6pd are born at the expected Mendelian frequency and do not show overt phenotype (PubMed:16356929). However, they display cellular inability to convert 11-dehydrocorticosterone (11-DHC) to corticosterone and present increased corticosterone to 11-DHC conversion associated with adrenal hyperplasia (PubMed:16356929). Mutant mice also display fasting hypoglycemia and perturbed lipid mobilization that are probably due to the aforementioned effect on corticosterone metabolism and blunted intracellular action of the hormone (PubMed:17656460, PubMed:18218694). Skeletal myopathy associated with a dysregulation of the expression of proteins associated with calcium homeostasis in the sarcoplasmic reticulum and an activation of the unfolded protein response are also observed (PubMed:18222920). In the N-terminal section; belongs to the glucose-6-phosphate dehydrogenase family. In the C-terminal section; belongs to the glucosamine/galactosamine-6-phosphate isomerase family. 6-phosphogluconolactonase subfamily. Extended N-terminus.