The objective of the study was to determine if cognitive function is associated with step time variability in people with multiple sclerosis (PwMS). The study included 355 PwMS (218 women), average age 41.1 (SD = 13.5), disease duration 5.9 (SD = 7.3) years, and a median expanded disability status scale score of 2.5. We separately analyzed the sample group of fallers and non-fallers based on their fall history. Gait variability was measured by an electronic walkway and all participants completed a computerized cognitive test battery designed to evaluate multiple cognitive domains. Fallers (43.7%) demonstrated elevated step time variability (%CV), 5.0 (SD = 3.4) vs. 3.5 (SD = 1.6), P < 0.001 compared to the non-faller subjects. According to the regression analysis in the non-fallers’ group, step time variability was found significantly associated with the global cognitive score (P = 0.001), executive function subcategory (P = 0.038), and motor skills subcategory (P < 0.001). No relationship between step time variability and any cognitive domain was demonstrated in the faller group. This study illustrated that the association between gait variability and cognition occurs only in PwMS without a fall history. From a clinical standpoint, these findings might help medical professionals to create improved assessment tests and rehabilitation strategies in the MS population.