Purpose To evaluate the efficacy and safety of ranibizumab and aflibercept in the treatment of diabetic macular edema in a real world study, and to compare the two treatments with each other. Methods Retrospective observational study of 213 eyes from 141 patients with diabetic macular edema was completed between June 2014 and June 2016. 122 were treated with ranibizumab intravitreal injection and 91 with aflibercept intravitreal injection, with a loading phase of 3 injections and a Pro Re Nata protocol. The drug was selected by the physician and fluorescein angiography was performed by physician's criteria. Re-treatment was performed when a decline in BCVA, an increase of central macular thickness or an increase or persistence of intraretinal fluid in OCT was observed. The primary outcome was the mean change in best corrected visual acuity at 1 year, while central macular thickness, central macular volume, the number of injections and visits were evaluated as secondary outcomes. The correlation between BCVA at 4th month visit and BCVA at 12th month visit was also evaluated. Results The mean baseline best corrected visual acuity for the eyes treated with ranibizumab was 0.55 (+/- 0.35) logMAR, and with aflibercept it was 0.48 (+/- 0.29) (P = 0.109). Best corrected visual acuity improved in both groups, and at the end of the follow-up was 0.40 (+/- 0.35) in the ranibizumab group and 0.40 (+/- 0.29) in the aflibercept group (P = 0.864). Best corrected visual acuity at 4th month visit is correlated at a high value (R = 0.789) with the one at the end of the study. No differences were found in central macular thickness, central macular volume and glycosylated hemoglobin when adjusting with baseline values. The overall number of injections was 5.77 (+/- 2.01), being 5.56 (+/- 2.0) in the ranibizumab group and 6.07 (+/- 1.99) in the aflibercept group (P = 0.069). The main outcome determining final best corrected visual acuity was the baseline best corrected visual acuity (P<0.001). Conclusion There are no differences in efficacy between ranibizumab and aflibercept in diabetic macular edema treatment in this real world study.