Background: Ceftriaxone and cefotaxime share a similar antibacterial spectrum and similar indications but have different pharmacokinetic characteristics. Ceftriaxone is administered once daily and 40% of its clearance is by biliary elimination, whereas cefotaxime requires three administrations per day and shows less than 10% biliary elimination. The high biliary elimination of ceftriaxone suggests a greater impact of this antibiotic on the gut microbiota than cefotaxime. The objective of this study was to compare the impact of ceftriaxone and cefotaxime on the gut microbiota. Methods: A prospective clinical trial was performed that included 55 patients treated with intravenous ceftriaxone (1 g/24 h) or cefotaxime (1 g/8 h) for at least 3 days. Three fresh stool samples were collected from each patient (days 0, 3, and 7 or at the end of intravenous treatment) to assess the emergence of third-generation cephalosporin (3GC)-resistant Enterobacteriaceae, carbapenem-resistant Enterobacteriaceae, Pseudomonas aeruginosa, toxigenic Clostridioides difficile, and vancomycin-resistant enterococci. Results: The emergence of 3GC-resistant gram-negative enteric bacilli (Enterobacteriaceae) (5.9% vs 4.7%, p > 0.99), Enterococcus spp, and non-commensal microorganisms did not differ significantly between the groups. Both antibiotics reduced the counts of total gram-negative enteric bacilli and decreased the cultivable diversity of the microbiota, but the differences between the groups were not significant. Conclusion: No significant difference was observed between ceftriaxone and cefotaxime in terms of the emergence of resistance.