As more and more people are diagnosed with autism spectrum disorder (ASD), it is necessary to better understand their costs. Detailed information on medical service utilization and costs could aid in designing equitable, effective policies to support individuals with ASD and their families. In this retrospective analysis, individuals with a hospital encounter (outpatient visit or inpatient admission) were collected from Beijing Municipal Health Big Data and Policy Research Center (BMHBD), from January 1, 2017 to December 31, 2021. We analyzed the costs, hospital visits/admissions and their changing trends over 5 years. Poisson regression and logit regression were conducted to analyze the influencing factors of visits, admissions and costs. The study population consisted of 26,826 users of medical services (26,583 outpatients and 243 inpatients; mean age: 4.82 ± 3.47 years for outpatients; 11.62 ± 6.74 years for inpatients). 99.1% were outpatients