Sunlight is closely intertwined with daily life. It remains unclear whether there are associations between sunlight exposure and brain structural markers. General linear regression analysis was used to compare the differences in brain structural markers among different sunlight exposure time groups. Stratification analyses were performed based on sex, age, and diseases (hypertension, stroke, diabetes). Restricted cubic spline was performed to examine the dose-response relationship between natural sunlight exposure and brain structural markers, with further stratification by season. A negative association of sunlight exposure time with brain structural markers was found in the upper tertile compared to the lower tertile. Prolonged natural sunlight exposure was associated with the volumes of total brain (β: – 0.051, P < 0.001), white matter (β: – 0.031, P = 0.023), gray matter (β: – 0.067, P < 0.001), and white matter hyperintensities (β: 0.059, P < 0.001). These associations were more pronounced in males and individuals under the age of 60. The results of the restricted cubic spline analysis showed a nonlinear relationship between sunlight exposure and brain structural markers, with the direction changing around 2 h of sunlight exposure. This study demonstrates that prolonged exposure to natural sunlight is associated with brain structural markers change.© 2024. The Author(s).