Carotid atherosclerosis is a common arterial wall lesion that causes narrowing and occlusion of the arteries and is the basis of cardiovascular events. Dietary habits, lifestyle, and lipid metabolism should be considered integrally in the context of carotid atherosclerosis (CAS). However, this area has been investigated less often in China. To understand the prevalence of CAS in China and the impact of dietary diversity and habits, lifestyle, and lipid metabolism on CAS as well as its predictive factors, a cross-sectional study was performed in two northern and southern Chinese tertiary hospitals from 2017 to 2019. Included participants underwent carotid artery color Doppler ultrasonography, blood lipid examination and dietary evaluation. In total, 11,601 CAS patients and 27,041 individuals without carotid artery lesions were included. The prevalence of CAS was 30.0% in this group. High BMI (OR: 1.685, 95% CI [1.315–2.160]), current (1.148 [1.077–1.224]) or ex-smoking (1.349 [1.190–1.529]), abstinence from alcohol ((1.223 [1.026–1.459]), social engagement (1.122 [1.050–1.198]), hypertension (1.828 [1.718–1.945]), and total cholesterol (1.438 [1.298–1.594]) were risk factors for CAS, while higher dietary diversity according to DDS-2 (0.891 [0.805–0.989]), HDL-C (0.558 [0.487–0.639]), sugar-sweetened beverages (0.734 [0.696–0.774]), and no midnight snack consumption (0.846 [0.792–0.903]) were protective factors. This current study demonstrated that higher dietary diversity was a protective factor against CAS in a healthy population. In addition, current recommendations of healthy lifestyle and dietary habits for preventing CAS should be strengthened. In addition, dietary diversity should concentrate on food attributes and dietary balance, rather than increased quantities.