Bacillus subtilis, a causative agent of foodborne illness in bread, cakes, cereals, and cheese leading to symptoms like diarrhea and nausea, was investigated for its role in nosocomial infections, including endocarditis, bacteremia, septicemia, and meningitis. The research focused on three genes: codY, narH, and ureC, which respectively contribute to bacterial survival through biofilm and spore formation, acid resistance, and adaptation to anaerobic conditions. The objective of this study was to evaluate the codY, narH, and ureC genes using the Gradient PCR method for Bacillus subtilis detection in bread and cheese through Real-Time PCR. During the research, bacterial growth was observed with an OD600 of 1.438 in Tryptic Soy Broth (TSB), and colonies of medium size, smooth, cream-coloured, and round shape were successfully isolated on Tryptic Soy Agar (TSA). The DNA template used had a 71.5 ng/µL concentration with an A260/280 ratio of approximately 1.830. The annealing temperature for Gradient PCR used was 53-62°C. The primers successfully amplified codY (175 bp), narH (222 bp), and ureC (153 bp) gene amplicons. The optimal annealing temperature for the primers used was 60°C, as indicated by the presence of a single bright band in electrophoresis. Using these three different genes, testing can also be conducted with the Multiplex PCR method. The next step involves developing a detection kit using optimized primers and annealing temperatures for the identification of Bacillus subtilis in bread and cheese samples using Real-Time PCR.