We aimed to compare the effects of cardiovascular disease risk in Japanese patients with type 2 diabetes on sodium–glucose cotransporter 2 inhibitors (SGLT2Is) or metformin. This retrospective, real‐world cohort study was carried out using a claims database and propensity score matching; 58,402 eligible patients (29,201 per group) were included. The outcomes included nonfatal myocardial infarction, angina pectoris, nonfatal stroke, hospitalization for heart failure and composite end‐points. The hazard ratio (HR) for the composite end‐point was 0.79, which was lower for SGLT2Is than for metformin. For male patients (HR 0.76), patients aged <65 years (HR 0.94), patients aged ≥75 years (HR 0.78) and patients with body mass index ≥25 kg/m2 (HR 0.76), the HRs for the composite end‐point were significantly lower in the SGLT2I group than in the metformin group. SGLT2Is might be superior to metformin in reducing the composite risk of cardiovascular disease in patients with type 2 diabetes.