The etiology of autism spectrum disorders (ASD) is for the majority of cases unknown and more studies of risk factors are needed. Geographic variation in ASD occurrence has been observed, and urban residence has been suggested to serve as a proxy for etiologic and identification factors in ASD. We examined the association between urbanicity level and ASD at birth and during childhood. The study used a Danish register-based cohort of more than 800,000 children of which nearly 4,000 children were diagnosed with ASD. We found a dose-response association with greater level of urbanicity and risk of ASD. This association was found for residence at birth as well as residence during childhood. Further, we found an increased risk of ASD in children who moved to a higher level of urbanicity after birth. Also, earlier age of ASD diagnosis in urban areas was observed. While we could not directly examine the specific reasons behind these associations, our results demonstrating particularly strong associations between ASD diagnosis and post-birth migration suggest the influence of identification-related factors such as access to services might have a substantive role on the ASD differentials we observed.