Some lactic acid bacteria (LAB) strains have the ability to synthesize riboflavin, a trait linked to the presence of rib G, rib B, rib A and rib H genes in the rib operon. Multiple sequence alignments of these genes showed that these sequences are not identical in different LAB species, so primers designed to detect these genes in one species do not always work with others. Therefore, we designed degenerate primers based on sequences from Lactococcus lactis MG1363, Levilactobacillus brevis ATCC 367 and Limosilactobacillus fermentum IFO3956, and established optimal PCR conditions for the detection of rib genes in different LAB species. Simultaneously, we selected riboflavin-producing LAB strains from our bacterial collection belonging to the species L. brevis, L. fermentum, L. lactis, Leuconostoc mesenteroides and Lactiplantibacillus plantarum, and we were able to detect rib G, rib B, rib A and rib H genes in these strains by PCR using the designed primers. Thus, the development of degenerate primers and optimal PCR conditions for the detection of rib G, rib B, rib A and rib H genes in LAB allowed the detection and the selection of potential riboflavin-producing strains of different species, which could be good candidates for the development of riboflavin-enriched functional foods. • Some LAB strains have the ability to synthesize riboflavin. • Riboflavin production in LAB is linked to rib G, rib B, rib A and rib H genes. • PCR with degenerate primers detect rib genes in different LAB species. • PCR using degenerate primers could select potential riboflavin-producing strains. • Selected strains will be applied to riboflavin-enriched functional foods. [ABSTRACT FROM AUTHOR]