ImportanceType 2 diabetes (T2D) is associated with an increased risk of kidney stones. Sodium-glucose cotransporter 2 inhibitors (SGLT2is) might lower the risk of nephrolithiasis by altering urine composition. However, no studies have investigated the association between SGLT2i use and nephrolithiasis risk in patients receiving routine care in the US.ObjectiveTo investigate the association between SGLT2i use and nephrolithiasis risk in clinical practice.Design, Setting, and ParticipantsThis new-user, active comparator cohort study used data from commercially insured adults (aged ≥18 years) with T2D who initiated treatment with SGLT2is, glucagon-like peptide 1 receptor agonists (GLP-1RAs), or dipeptidyl peptidase 4 inhibitors (DPP4is) between April 1, 2013, and December 31, 2020. The data were analyzed from July 2021 through June 2023.ExposureNew initiation of an SGLT2i, GLP-1RA, or DPP4i.Main Outcomes and MeasuresThe primary outcome was nephrolithiasis diagnosed by International Classification of Diseases codes in the inpatient or outpatient setting. New SGLT2i users were 1:1 propensity score matched to new users of a GLP-1RA or DPP4i in pairwise comparisons. Incidence rates, rate differences (RDs), and estimated hazard ratios (HRs) with 95% CIs were calculated.ResultsAfter 1:1 propensity score matching, a total of 716 406 adults with T2D (358 203 pairs) initiating an SGLT2i or a GLP-1RA (mean [SD] age, 61.4 [9.7] years for both groups; 51.4% vs 51.2% female; 48.6% vs 48.5% male) and 662 056 adults (331 028 pairs) initiating an SGLT2i or a DPP4i (mean [SD] age, 61.8 [9.3] vs 61.7 [10.1] years; 47.4% vs 47.3% female; 52.6% vs 52.7% male) were included. Over a median follow-up of 192 (IQR, 88-409) days, the risk of nephrolithiasis was lower in patients initiating an SGLT2i than among those initiating a GLP-1RA (14.9 vs 21.3 events per 1000 person-years; HR, 0.69 [95% CI, 0.67-0.72]; RD, −6.4 [95% CI, −7.1 to −5.7]) or a DPP4i (14.6 vs 19.9 events per 1000 person-years; HR, 0.74 [95% CI, 0.71-0.77]; RD, −5.3 [95% CI, −6.0 to −4.6]). The association between SGLT2i use and nephrolithiasis risk was similar by sex, race and ethnicity, history of chronic kidney disease, and obesity. The magnitude of the risk reduction with SGLT2i use was larger among adults aged younger than 70 years vs aged 70 years or older (HR, 0.85 [95% CI, 0.79-0.91]; RD, −3.46 [95% CI, −4.87 to −2.05] per 1000 person-years; P for interaction <.001).Conclusions and RelevanceThese findings suggest that in adults with T2D, SGLT2i use may lower the risk of nephrolithiasis compared with GLP-1RAs or DPP4is and could help to inform decision-making when prescribing glucose-lowering agents for patients who may be at risk for developing nephrolithiasis.