Background: Anxiety and depression are among the most common comorbidities associated with multiple sclerosis (MS). Findings by MS subtype are conflicting, potentially due to limited data availability and underreporting in electronic health records (EHRs). FlywheelMS, a study aimed at digitizing all paper, electronic and imaging health records of patients with MS across care sites, may better inform our understanding of these associations. Objectives: To examine the relative prevalence of depression and anxiety by MS subtype in the FlywheelMS cohort. Methods: Adults aged ?18 years with MS confirmed in EHRs were recruited to FlywheelMS from across the US. Supervised machine learning with human curation was used to retrieve, digitize and abstract all available medical records, which were collected retrospectively. MS subtype (relapsing remitting [RRMS], secondary progressive [SPMS], primary progressive [PPMS]) was determined from the most recent neurology visit records. Prevalence of depression and anxiety was determined from EHR diagnosis tables in the year before enrollment. Results: As of August 19, 2020, data on 3,512 patients with MS were available, including MS subtype information for 2,547 patients (72.5%). Female patients were more prevalent in RRMS (n=1,622; 82.3%) and SPMS (n=102; 80.9%) than PPMS (59.4%; n=64). Mean [SD] age varied by MS subtype (RRMS, 49.9 [11.1] years; SPMS, 53.6 [11.6] years; PPMS, 57.9 [9.1] years). Overall prevalence (±95% CI) of depression was 17.6%±0.8%, which is comparable to rates from a recent analysis of patients with MS in Canada (19.1%±0.003%; n=23,382) but higher than a general population cohort matched on sex, birth year and region included in the same analysis (9.4%±0.09%; n=116,638). Depression was more prevalent in patients with RRMS (18.9%±1.0%) or SPMS (19.6%±3.9%) than PPMS (12.5%±4.1%). Overall prevalence of anxiety was 12.6%±0.6%, which is comparable to the same recent health records database (11.1%±0.002%) and higher than the matched controls (6.9%±0.07%). Anxiety was more prevalent in patients with RRMS (13.5%±0.8%) than with SPMS (9.8%±2.9%) or PPMS (6.2%±3.0%). Conclusions: Overall, patients with MS in FlywheelMS had a higher prevalence of depression and anxiety than what has been reported for the general population, with variable rates across MS subtypes. Additional analysis is required to explore the relationship between anxiety/depression and demographics, disease characteristics and disability accumulation.