The aims of this study were to determine rates of early postkeratoplasty endophthalmitis and identify sociodemographic and medical risk factors in the Medicare population. Using a retrospective cohort design, patients aged 65 years and older undergoing penetrating keratoplasty (PK), endothelial keratoplasty (EK), and anterior lamellar keratoplasty (ALK) from 2016 to 2019 among 100% Medicare Fee-or-Service database were included. Rates of early endophthalmitis within 42 days of keratoplasty were determined using the International Classification of Diseases, 10th Revision-Clinical Modification diagnostic codes. Patient and physician characteristics were compared using x2 tests, and a multivariable logistic regression model was used to evaluate factors associated with endophthalmitis. The overall early endophthalmitis rate after keratoplasty was 0.39% (n = 216/54,822) with a median time to diagnosis of 14 (interquartile range: 5-25) days. Rates by keratoplasty types were 1.31% for cataract surgery combined with PK, 1.13% for PK, and 0.22% for EK. On multivariable analysis, the odds of endophthalmitis were higher for PK [odds ratio (OR): 5.46, 95% confidence interval (CI), 3.98-7.49] and ALK (OR: 5.45, 95% CI, 2.59-11.49) relative to EK. Patients with a Charlson Comorbidity Index (CCI) ≥3 had higher odds of endophthalmitis (OR: 1.82; 95% CI, 1.28-2.58) relative to patients with a CCI of 0. Practices located in the Midwest (OR: 0.59, 95% CI, 0.36-0.96), West (OR 0.57; 95% CI, 0.35-0.93), and Northeast (OR: 0.59 95% CI, 0.35-0.99) had lower odds of reporting endophthalmitis when compared to the South. Patients undergoing PK and ALK and those with a CCI ≥3 had higher odds of endophthalmitis relative to EK and patients without comorbidities, respectively. Practices in the West, Midwest, and Northeast had lower odds of endophthalmitis relative to the South.