Introduction Neonatal mortality might be higher in urban areas. This paper aims to minimize challenges related to misclassification of neonatal deaths and stillbirths, and oversimplification of the variation in urban environments to accurately estimate the direction and strength of the association between urban residence and neonatal/perinatal mortality in Tanzania. Methods The Tanzania Demographic and Health Survey (DHS) 2015-16 was used to assess birth outcomes for 8,915 pregnancies among 6,156 women of reproductive age, by urban or rural categorization in the DHS and based on satellite imagery. The coordinates of 527 DHS clusters were spatially overlaid with the 2015 Global Human Settlement Layer, showing the degree of urbanisation based on built environment and population density. A three-category urbanicity measure (core urban, semi-urban, and rural) was defined and compared to the binary DHS measure. Travel time to the nearest hospital was modelled using least-cost path algorithm for each cluster. Bivariate and multi-level multivariable logistic regression models were constructed to explore associations between urbanicity and neonatal/perinatal deaths. Results Both perinatal and neonatal mortality rates were highest in core urban and lowest in rural clusters. Bivariate models showed higher odds of neonatal death (OR=1.85; 95% CI: 1.12, 3.08) and perinatal death (OR=1.60; 95% CI 1.12, 2.30) in core urban compared to rural clusters. In multivariable models, these associations had the same direction and size, but were no longer statistically significant. Travel time to nearest hospital was not associated with neonatal or perinatal mortality. Conclusion Addressing the higher rates of neonatal and perinatal mortality in densely populated urban areas is critical for Tanzania to meet national and global reduction targets. Urban populations are diverse, and certain neighbourhoods or sub-groups may be disproportionately affected by poor birth outcomes. Research must sample within and across urban areas to differentiate, understand and minimize risks specific to urban settings.