Biofloc technology has a high impact on enhancing shrimp production. Suitable supplemented carbohydrates (CHO) could affect the type of microorganisms developed in the system, which reflects on shrimp production, food safety, and public health. Here, we aimed to compare the effects of sugarcane molasses and wheat flour as carbohydrate sources on biofloc technology. That was achieved through measuring the following parameters: water quality, growth performance, feed utilization, floc composition, shrimp whole body composition, microbial community, and biofloc shrimp food bacterial quality. Postlarvae of whiteleg shrimp (Litopenaeus vannamei) with a mean weight (38.47 +/- 5.8 mg) were stocked at a density of 200 individuals/m(2) and cultured under a biofloc system for 128 days in six tanks with a total water volume of 30 m(2) each. Water quality analysis revealed a better-dissolved oxygen concentration (5.59 mg/L) in the wheat flour treatment, whereas no significant differences were found between the two treatments in ammonia, nitrite, and pH levels. Increased turbidity (64.27 NTU) and floc volume (18.40 mL/L) were recorded with molasses treatment. Growth performance including final weight, weight gain, average daily gain, weight gain per week, and specific growth rate (12.37 g, 12.34 g, 0.096 g/d, 0.68, and 4.70\%, respectively) were all significantly higher in the molasses treatment. Wheat flour treatment was associated with a higher survival rate (99\%), biomass (71.16 Kg), and biomass increase percentage (395.337) in shrimps. It also improved feed utilization in terms of a lower feed conversion ratio (1.37) and higher protein efficiency ratio (1.92). The chemical composition of biofloc and shrimp whole body were both nutritious higher in wheat flour treatment. In water, total heterotrophic bacterial counts with sugarcane molasses treatment and wheat flour were estimated as 3.4x10(5) CFU/mL and 1.2x105 CFU/mL, respectively, with no significant difference. In both treatments, beneficial bacteria such as lactic acid bacteria and Enterobacter cloacae were identified in water with the absence of pathogenic Vibrio spp. Wheat flour had a significantly lower total Vibrio-like count (TVC). Shrimps had lower TVC (1.9x10(4) CFU/g) with flour than with molasses (1.32x10(5) CFU/g). Cronobacter spp. were associated with shrimps in BFT supplemented with molasses, which might pose a potential risk to food safety. In conclusion, the use of wheat flour was the best for shrimp production and shrimp food bacterial quality.