Background China’s urban-rural divide, though still improving, can be seen from various sectors of the economy. The objective of this study is to explore how socioeconomic factors in and across both urban and rural areas explain the occurrence of foodborne illness in China. Over the last decades, food safety laws and regulations have been established in China, but more understanding about the food safety issues are needed in order to eliminate food safety hazards. Methods This study intends to estimate several panel data models in econometrics to obtain the average partial effects of many socioeconomic factors in and across urban and rural areas on per capita foodborne incidents and patients, respectively. Given the fractional nature of the two dependent variables, fractional probit models are estimated using both the Quasi Maximum Likelihood Estimation (QMLE) and the bootstrap Generalized Estimating Equations (GEE) approaches in addition to the standard estimation of panel data random effects, fixed effects, and Tobit models. China official data on foodborne incident and patient cases in each province and in each year from 2011 to 2018 are obtained from various issues of the China Health Statistical Yearbook. Additional data on 19 socioeconomic variables are obtained from various issues of the China Statistical Yearbook. Results The main results show that socioeconomic factors such as owning TVs, owning refrigerators, consumption expenditures and household income in urban or rural areas explain the per capita foodborne incidents or per capita foodborne patients differently, reflecting differences in people’s food safety awareness, food storage patterns, food markets, and income effects in the urban and rural areas. Socioeconomic factors such as urbanization and primary industry’s share of the gross regional product across areas tend to worsen the food safety problem. Improving regional economies and increasing government spending on public health could reduce the occurrence of foodborne illness. Conclusions It is suggested that governments take into account the social disparities of urban and rural areas when designing and implementing food safety policies. It is also suggested that a holistic approach is needed to resolve food safety issues by combining food safety control and management policies with soil and water management policies.