Although intestinal and urinary microbiome perturbations are associated with nephrolithiasis, whether antibiotics are a risk factor for this condition remains unknown. We determined the association between 12 classes of oral antibiotics and nephrolithiasis in a population-based, case-control study nested within 641 general practices providing electronic health record data for >13 million children and adults from 1994 to 2015 in the United Kingdom. We used incidence density sampling to match 25,981 patients with nephrolithiasis to 259,797 controls by age, sex, and practice at date of diagnosis (index date). Conditional logistic regression models were adjusted for the rate of health care encounters, comorbidities, urinary tract infections, and use of thiazide and loop diuretics, proton-pump inhibitors, and statins. Exposure to any of five different antibiotic classes 3-12 months before index date was associated with nephrolithiasis. The adjusted odds ratio (95% confidence interval) was 2.33 (2.19 to 2.48) for sulfas, 1.88 (1.75 to 2.01) for cephalosporins, 1.67 (1.54 to 1.81) for fluoroquinolones, 1.70 (1.55 to 1.88) for nitrofurantoin/methenamine, and 1.27 (1.18 to 1.36) for broad-spectrum penicillins. In exploratory analyses, the magnitude of associations was greatest for exposure at younger ages (<0.001) and 3-6 months before index date (<0.001), with all but broad-spectrum penicillins remaining statistically significant 3-5 years from exposure. Oral antibiotics associated with increased odds of nephrolithiasis, with the greatest odds for recent exposure and exposure at younger age. These results have implications for disease pathogenesis and the rising incidence of nephrolithiasis, particularly among children.