Our study found that the glycemic gap was significantly associated with stroke recurrence in patients with ischemic stroke. The glycemic gap was consistently associated with stroke recurrence across subgroups and had varying effects depending on atrial fibrillation.