BackgroundThis study aimed to investigate the relationship between oxidation balance score (OBS) and constipation.MethodsAll data was collected from the 2005–2010 cycles of the National health and nutrition examination survey (NHANES) database. The relationship between OBS and constipation was analyzed by logistic regression, restricted cubic spline. Trend analysis was used to explore whether there is a linear relationship between OBS quartiles and constipation, while interaction analysis was conducted to determine whether other factors influence the relationship between OBS and constipation. Subgroup analysis was used to examine the relationship between the two in different subgroups. The three machine learning algorithms including Xgboost, Randomforest, and AdaBoost was used to analyze the important component of OBS in constipation.ResultsA total of 8,074 participants were involved. We found that there was a negative linear relationship between OBS and constipation. The relationship also existed after adjusting for all possible confounders. The trend test showed that the higher the OBS, the lower the likelihood of developing constipation (P for trend<0.05). The interaction analysis showed that marital status and diabetes interact with OBS on constipation. The receiver operating characteristic analysis indicated that OBS had a good prediction efficiency on constipation, especially in participants without diabetes and with the status of married or living with a partner. We also found that the body mass index and magnesium were important OBS components related to constipation.ConclusionOxidation balance score was negatively associated with the occurrence of constipation in adults. Moreover, body mass index and magnesium were important OBS components related to constipation.