The data discussed in this article is related to the article entitled “ Identity and trust in government: A comparison of locals and migrants in urban China” (Niu and Zhao, 2018) [1], which analyses the political trust among three groups of urban residents in China (rural–urban migrants, urban–urban migrants, and urban locals) based on a sample with 4059 observations extracted from the 2010 Chinese General Social Survey (CGSS). The dataset contains detailed information on respondents’ political and social attitudes, demographic characteristics, and socio-economic status.