The biosynthetic precursors to riboflavin are ribulose 5-phosphate and guanosine triphosphate. The former is converted to L-3,4-dihydroxy-2-butanone-4-phosphate while the latter is transformed in a series of reactions that lead to 5-amino-6-(D-ribitylamino)uracil. These two compounds are then the substrates for the penultimate step in the pathway, catalysed by the enzyme lumazine synthase in reaction EC 2.5.1.78. In the final step of the biosynthesis, two molecules of 6,7-dimethyl-8-ribityllumazine are combined by the enzyme riboflavin synthase in a dismutation reaction. This generates one molecule of riboflavin and one of 5-amino-6-(D-ribitylamino) uracil. The latter is recycled to the previous reaction in the sequence. Conversions of riboflavin to the cofactors FMN and FAD are carried out by the enzymes riboflavin kinase and FAD synthetase acting sequentially. Industrial synthesis
The industrial-scale production of riboflavin uses various microorganisms, including filamentous fungi such as Ashbya gossypii, Candida famata and Candida flaveri,  as well as the bacteria Corynebacterium ammoniagenes and Bacillus subtilis. B. subtilis that has been genetically modified to both increase the production of riboflavin and to introduce an antibiotic (ampicillin) resistance marker, is employed at a commercial scale to produce riboflavin for feed and food fortification. By 2012, over 4,000 tonnes per annum were produced by such fermentation processes.In the presence of high concentrations of hydrocarbons or aromatic compounds, some bacteria overproduce riboflavin, possibly as a protective mechanism.
There is speculation that unabsorbed riboflavin could affect the large intestine microbiome. Deficiency
Prevalence
Riboflavin deficiency is uncommon in the United States and in other countries with wheat flour or corn meal fortification programs. From data collected in biannual surveys of the U.S. population, for ages 20 and over, 22% of females and 19% of men reported consuming a supplement that contained riboflavin, typically a vitamin-mineral multi-supplement. For the non-supplement users, the dietary intake of adult women averaged 1.74 mg/day and men 2.44 mg/day. These amounts exceed the RDAs for riboflavin of 1.1 and 1.3 mg/day respectively. For all age groups, on average, consumption from food exceeded the RDAs. A 2001-02 U.S. survey reported that less than 3% of the population consumed less than the Estimated Average Requirement of riboflavin. Signs and symptoms
Riboflavin deficiency (also called ariboflavinosis) results in stomatitis, symptoms of which include chapped and fissured lips, inflammation of the corners of the mouth (angular stomatitis), sore throat, painful red tongue, and hair loss. The eyes can become itchy, watery, bloodshot, and sensitive to light. Riboflavin deficiency is associated with anemia. Prolonged riboflavin insufficiency may cause degeneration of the liver and nervous system. Riboflavin deficiency may increase the risk of preeclampsia in pregnant women. Deficiency of riboflavin during pregnancy can result in fetal birth defects, including heart and limb deformities. Risk factors
People at risk of having low riboflavin levels include alcoholics, vegetarian athletes, and practitioners of veganism. Pregnant or lactating women and their infants may also be at risk, if the mother avoids meat and dairy products.