Pentose phosphate pathway and isocitrate dehydrogenase are generally considered to be the major sources of the anabolic reductant NADPH. As one of very few microbes, Escherichia coli contains two transhydrogenase isoforms with unknown physiological function that could potentially transfer electrons directly from NADH to NADP+ and vice versa. Using defined mutants and metabolic flux analysis, we identified the proton-translocating transhydrogenase PntAB as a major source of NADPH in E. coli. During standard aerobic batch growth on glucose, 35-45% of the NADPH that is required for biosynthesis was produced via PntAB, whereas pentose phosphate pathway and isocitrate dehydrogenase contributed 35-45% and 20-25%, respectively. The energy-independent transhydrogenase UdhA, in contrast, was essential for growth under metabolic conditions with excess NADPH formation, i.e. growth on acetate or in a phosphoglucose isomerase mutant that catabolized glucose through the pentose phosphate pathway. Thus, both isoforms have divergent physiological functions: energy-dependent reduction of NADP+ with NADH by PntAB and reoxidation of NADPH by UdhA. Expression appeared to be modulated by the redox state of cellular metabolism, because genetic and environmental manipulations that increased or decreased NADPH formation down-regulated pntA or udhA transcription, respectively. The two transhydrogenase isoforms provide E. coli primary metabolism with an extraordinary flexibility to cope with varying catabolic and anabolic demands, which raises two general questions: why do only a few bacteria contain both isoforms, and how do other organisms manage NADPH metabolism?