Association of Healthy Eating Index-2020 with muscle mass among the middle-aged individuals — a cross-sectional study based on NHANES from 2011 to 2018 Authors: Xinyue Wei, Shuai Guo, Ziyang Ren, Panliang Zhong, Binbin Su, Zuliyaer Talifu, Xiaoying Zheng Published: 2025 ABSTRACT BackgroundLow muscle mass exhibits a high prevalence in population, with its incidence increasing with age. Body mass index (BMI) has been identified as an independent predictor of poor muscle quality, and people with higher BMI have higher risk of low muscle mass. Nutrition interventions have been demonstrated efficacy in mitigating its effects. The Healthy Eating Index-2020 (HEI-2020) assesses overall diet quality but lacks studies on its association with low muscle mass. This study aims to investigate the association between the HEI-2020 and low muscle mass and to explore the mediating role of BMI among middle-aged individuals.MethodsParticipants aged 40–59 were recruited from the National Health and Nutrition Examination Survey (NHANES) 2011–2018. Muscle mass was quantified using the ratio of appendicular lean mass (ALM) to BMI, with low muscle mass criteria defined at 0.789 kg/kg/m2 for men and 0.512 kg/kg/m2 for women. The HEI-2020 score was constructed based on two days of 24-hour dietary recalls and consists of 13 components. Logistic regression models analyzed the associations between HEI-2020, its components, and low muscle mass. Mediation analysis assessed the role of BMI in the association between HEI-2020 and low muscle mass.ResultsThe sample comprised 4,355 individuals with a median age of 50 (45, 55) years, of whom 9.7% had low muscle mass. The HEI-2020 scores ranged from 22.85 to 91.33, with an average score of 52.10 ± 11.78. Participants in the highest HEI-2020 score quartile had a 65% lower risk of low muscle mass compared to those in the lowest quartile. Adequate intake of vegetables, fruits, beans, proteins and fatty acids, along with restricted intake of added sugars, was associated with lower risk of low muscle mass. BMI was identified as a mediator, accounting for 33.1% of the association between HEI-2020 and low muscle mass.ConclusionsHEI-2020 was inversely associated with low muscle mass among middle-aged individuals. The impact of a healthy diet on muscle mass is partially mediated by BMI. Adhering to the healthy eating patterns and keeping a healthy weight is conducive to the maintenance of muscle mass and the prevention of low muscle mass.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12937-025-01254-x. Introduction Skeletal muscle is one of the most dynamic and malleable tissues in the human body, accounting for approximately 30% to 40% of total body weight [1]. It plays a crucial role in functions such as exercise, metabolism, maintenance of blood glucose balance, and is associated with disease prevention and health maintenance [1]. Age is a significant factor for human muscle mass, which typically peaks around the age of 30, subsequently declining by approximately 1% every year, with a marked acceleration in loss after age 60 [2, 3]. Low muscle mass is very common in adults, particularly in older populations and patients with acute or chronic diseases [4]. According to previous studies, the global prevalence of low muscle mass is approximately 27%, with similar rates observed in individuals aged under 60 years and those aged 60 years or above [5]. Research has shown that body mass index (BMI) is an independent predictor of poor muscle quality, and obese individuals are more likely to have low muscle mass [6]. One study from the U.S. revealed a 12.0% prevalence of low muscle mass in older adults [7], and another study showed that the prevalence of low muscle mass was higher in obese populations: 15.9% overall (8.1% in adults aged 20–59 vs. 28.3% in those ≥60 years) [8]. Low muscle mass is associated with higher morbidity and mortality risks, and it’s also the independent predictor of adverse clinical outcomes, such as falls and fractures, physical impairment or disability, wound healing, tumor progression, prolonged hospital stay, and reduced quality of life [4, 9]. However, it is worth noting that low muscle mass is preventable through early intervention. Studies have shown that nutrition and diet significantly influence muscle health [10], however, evidence remains limited. Most existing studies primarily focus on the impact of single nutrients on muscle mass, reporting beneficial effects of branched-chain amino acids, vitamin D, proteins, and other nutrients [11–13]. However, these studies often overlook the complex interplay and synergistic effects of multiple nutrients when combined within the dietary matrix. Therefore, considering the interactions between dietary components, Healthy Eating Index (HEI) was developed as one of the measures to evaluate overall dietary quality and reflect dietary patterns. It has been updated to HEI-2020 to alignment with the Dietary Guidelines for Americans (DGA)2020–2025 [14]. DGA is the basis of the U.S. government’s nutrition policy and the foundation of all federal nutrition guidelines, and it is also the authoritative scientific guide to dietary practice, aiming to improve health, reduce the risk of chronic diseases and fulfill nutritional requirement [15, 16]. HEI has been widely used in monitoring and epidemiological studies to investigate the dietary quality of populations and the association between dietary quality and health outcomes [14]. Malnutrition is a risk factor for low muscle mass [17]. HEI has been demonstrated to be associated with body composition [18], which may be related to its potential biological mechanisms including antioxidant, anti-inflammatory, acid-base balance and beneficial gut microbiota through its diverse nutrient components [19]. Although some relevant investigations have revealed that a higher score on the HEI correlates with a lower risk for low grip strength, poor physical performance and other adverse health outcomes [20, 21], the evidence on the association between HEI and low muscle mass is still limited. Therefore, this study aims to explore the association between HEI-2020 and low muscle mass. Considering the significant impact of middle age on the development of muscle mass loss, we choose middle-aged individuals as the target population to examine whether adherence to the healthy diet can mitigate the risk of low muscle mass and provide quantitative evidence for the role of early prevention. Given the impact of BMI on muscle mass, this study also explores the mediating role of BMI on the association between HEI-2020 and low muscle mass. Materials and methods Study population This study utilized data from the National Health and Nutrition Examination Survey (NHANES), a nationwide multi-stage sampling survey launched in the early 1960s to collect demographic, socioeconomic, dietary, physical examination, laboratory test, and other health-related information from adults and children in the United States, with biennial resampling [22]. The NHANES sample is representative of the entire U.S. population and encompasses diverse ethnic groups, including Mexican American, Other Hispanic, Non-Hispanic White, Non-Hispanic Black, Non-Hispanic Asian, and Other Races-Including Multi-Racial [23]. This study included samples from all ethnic groups, categorized as Mexican American, Non-Hispanic White, Non-Hispanic Black, and Other Races. Ethical review was approved by National Center for Health Statistics (NCHS) Ethics Review Board [24]. All participants provided the written informed consent. More detailed information is available at https://www.cdc.gov/nchs/nhanes/index.html. This study employed data from NHANES 2011–2018, the study design and exclusion criteria are shown in Fig. 1. Fig. 1Flowchart of the study population. Abnormal energy intake records refer to total energy intake of less than 500 or greater than 5,000 kcal/day for females, and less than 500 or greater than 8,000 kcal/day for males. NHANES: National Health and Nutrition Examination Survey Flowchart of the study population. Abnormal energy intake records refer to total energy intake of less than 500 or greater than 5,000 kcal/day for females, and less than 500 or greater than 8,000 kcal/day for males. NHANES: National Health and Nutrition Examination Survey Healthy Eating Index − 2020 The HEI-2020 is a measure of overall diet quality designed to assess alignment with the DGA 2020–2025. The HEI-2020 is computed on the basis of two days of 24-hour dietary recalls and consists of 13 components, including 9 adequacy components (total fruits, whole fruits, total vegetables, greens and beans, whole grains, dairy, total protein foods, seafood and plant proteins, fatty acids), and 4 moderation components (refined grains, sodium, added sugars, saturated fats) [14]. Adequacy components reflect the encouraged intake of food categories, subcategories, and dietary elements, with higher scores indicating greater consumption. In contrast, moderation components pertain to food categories and dietary elements that should be limited, with higher scores indicating lower consumption [25]. The total HEI-2020 score ranges from 0 to 100, with higher scores indicating better diet quality [26]. For further details, please refer to Table S1 [14]. The construction of HEI-2020 in this study was conducted using the R package “dietary index”, which offers a user-friendly and streamlined approach to standardizing dietary intake data into index-based dietary patterns, achieving complete accuracy (100%) in all common functions [27]. Muscle mass Muscle mass data from the NHANES were measured using dual-energy X-ray absorptiometry (DXA). DXA is the gold standard technique for evaluating body composition at the molecular level, including fat mass, non-bone lean mass, and bone mineral content [28]. DXA is based on the basic physical principle of measuring the transmission of two different energy levels (high and low) of X-rays through the body, and determines the body composition by measuring the ratio of attenuation coefficients at the two different peaks of energy (R-value) [28]. And DXA is able to measure regional body compositions by subdividing the body using specific well-defined cut lines [29]. Lean mass is an indicator of muscle mass based on imaging, therefore in this study low muscle mass is defined as an appendicular lean mass (ALM)/BMI ratio of less than 0.789 kg/kg/m2 for men and less than 0.512 kg/kg/m2 for women, according to the diagnostic criteria established by Foundation for the National Institutes of Health (FNIH) [30]. ALM is defined as the total lean mass of the bilateral upper and lower limbs. BMI is calculated by dividing weight (kg) by height (m) squared. Covariate definitions Based on past relevant literature and data availability, this study selected the following covariates: age, sex, ethnicity, education, economic status, marital status, BMI, smoking status, alcohol consumption, physical activity, and the number of chronic conditions. Sex was categorized as male and female. Ethnicity was categorized as Mexican American, Non-Hispanic White, Non-Hispanic Black, and Other Race [31]. Education was classified into three levels: less than high school, high school graduate, and college or higher [32]. Economic status was assessed using family income to poverty, based on the Department of Health and Human Services (HHS) poverty guidelines, and categorized as ≤1.30, 1.30–1.85 and >1.85 [33]. Marital status was divided into two categories: married and unmarried [7]. BMI was categorized as normal or low weight (≤25 kg/m2), overweight (>25&≤30 kg/m2), obese (>30 kg/m2). Smoking status was categorized into three groups: never (smoking fewer than 100 cigarettes in one’s lifetime), former (smoking more than 100 cigarettes in one’s lifetime and currently not smoking), and current (more than 100 cigarettes in one’s lifetime and currently smoking) [34]. Alcohol consumption was categorized as no (less than 12 drinks in any given year during 2011–2016 waves or no consumption ever in 2017–2018 wave) and yes (at least 12 drinks in a year during 2011–2016 waves or any consumption in 2017–2018 wave) [20]. Physical activity was categorized into two categories: yes (engaging in vigorous or moderate physical activity) and no (not engaging in vigorous moderate physical activity) [35]. The number of chronic conditions was classified into three categories: 0 (no diagnosed chronic condition), 1 (one diagnosed chronic condition), and 2 or more (two or more diagnosed chronic conditions), including the following types: arthritis, congestive heart failure, coronary heart disease, angina pectoris, heart attack, stroke, cancer, and diabetes [20]. Statistical analysis In this study, response variable was low muscle mass and the explanatory variables were HEI-2020, age, sex, ethnicity, education, economic status, marital status, smoking status, alcohol consumption, physical activity, and the number of chronic conditions. Appropriate weights were selected in accordance with the NHANES guidelines (https://wwwn.cdc.gov/nchs/nhanes/tutorials/Module3.aspx) and complex sampling design was considered in statistical analysis. In this study, observations with missing values in the exposure or outcome variables were excluded. Missing values in the covariates were handled using multiple imputation by chained equations (MICE). We assessed multicollinearity using variance inflation factors (VIF), and the results indicated no substantial multicollinearity among the covariates (mean VIF = 1.64). The normality of continuous variables was assessed. Data with normal distribution are presented as weighted mean ± standard deviation, while non-normally distributed data are presented as weighted median (interquartile range). Categorical variables are reported as unweighted frequency and weighted percentage. Differences were evaluated using analysis of variance (ANOVA) or Kruskal-Wallis test for continuous variables and chi-square tests for categorical variables. The score of HEI-2020 and its 13 components was divided into quartiles, with the first quartile serving as the reference group representing the lowest quality and the fourth quartile representing the highest quality. A logistic regression model was employed to analyze the association between HEI-2020 and low muscle mass, as well as the association between HEI-2020 components and low muscle mass. Model 1 was not adjusted. Model 2 was adjusted for socio-demographic characteristics, including age, sex, ethnicity, education, economic status and marital status. Model 3 was adjusted for behavioral factors, such as smoking status, alcohol consumption, physical activity, and the number of chronic conditions, based on Model 2. Additionally, the median of HEI-2020 score in each quartile were calculated and used as a continuous variable to perform a trend test (P for trend). Restricted cubic spline (RCS) curves were used to describe the dose-response relationship between HEI-2020 and low muscle mass. Mediation analysis, with BMI as the mediator, were conducted to explore the complex association among HEI-2020, BMI, and muscle mass. Stratified analysis were performed by socio-demographic characteristics. To examine the robustness of our primary findings, we conducted a sensitivity analysis following three exclusion criteria: (1) the listwise deletion of all missing data, (2) the exclusion of individuals with extreme obesity (BMI ≥40 kg/m²) or severe underweight (BMI <16.5 kg/m²) [36], and (3) the removal of the top and bottom 1% of BMI values (BMI <18.6 kg/m² or BMI >50.3 kg/m²). This analysis evaluated the associations of HEI-2020 (both total score and components) with low muscle mass, as well as the mediation effects of BMI. Data processing was conducted using STATA (version 18) and R (4.3.3). Visualization was created with R (4.3.3) and Adobe Illustrator 2021. A two-tailed p value of <0.05 was considered statistically significant. Results Baseline characteristics of participants As depicted in Table 1, a total of 4,355 study participants were enrolled in this study, with a median age of 50 (45, 55) years, and female proportion of 51.4%. The HEI-2020 score ranged from 22.85 to 91.33, with an average score of 52.10 ± 11.78. Compared to those with lower HEI-2020 score, individuals in the highest HEI-2020 score category exhibited a higher likelihood of being older, being other race, being married, achieving a higher education level (college or above), having a higher poverty to income ratio (>1.85), and engaging in more physical activity. And they were also less likely to be current smoker and to have low muscle mass. There were no significant differences in sex, alcohol consumption and number of chronic conditions across HEI-2020 quartiles (P = 0.247, P = 0.052 and P = 0.058 respectively). The HEI-2020 scores were higher for individuals without low muscle mass compared to those with low muscle mass. Specifically, the average HEI-2020 scores were 52.50 ± 11.72 for those without low muscle mass and 48.37 ± 11.61 for those with low muscle mass (Table S2). For the adequacy components of HEI-2020, except for total protein foods score, which was about 80% of the recommended score, the others were around 30–50% of the recommended scores. As for the moderation components of HEI-2020, scores of them were around 30–60% of the recommended scores (Table S3). As for BMI, people with obesity had lower HEI-2020 score and a higher risk of low muscle mass (P <0.001). In the lowest quartile of HEI-2020 score, the proportion of individuals with obesity scores was 50%, while in the low muscle mass group was 74.3% (Table 1 and Table S2). Table 1Baseline characteristics of study participants (40 years ≤ age ≤ 59 years) by Healthy Eating Index-2020 from NHANES 2011–2018, n = 4355CharacteristicsHEI-2020 score categoryTotalQ1Q2Q3Q4 P Range of HEI-2020 22.85 to 91.3322.85 to 43.3743.38 to 51.2451.25 to 60.4360.45 to 91.33 HEI-2020 52.10 ± 11.7837.52 ± 4.2447.26 ± 2.2555.74 ± 2.7368.07 ± 6.10< 0.001 Age 50 (45, 55)50 (45, 54)49 (44, 55)50 (45, 55)51 (45, 56)0.004 Sex (%) 0.247 Male2050 (48.6)546 (52.6)544 (49.6)493 (46.5)467 (45.6) Female2305 (51.4)543 (47.4)545 (50.4)596 (53.5)621 (54.4) Ethnicity (%) < 0.001 Mexican American591 (8.5)125 (8.4)140 (8.0)186 (10.1)140 (7.5) Non-Hispanic White1573 (64.8)484 (65.7)431 (67.9)354 (64.0)304 (61.1) Non-Hispanic Black989 (10.9)279 (13.6)264 (11.7)241 (9.3)205 (8.9) Other Race1202 (15.8)201 (12.2)254 (12.4)308 (16.6)439 (22.4) Education (%) < 0.001 Less than high school787 (12.2)245 (17.4)193 (11.7)196 (11.8)144 (7.9) High school graduate946 (22.2)316 (31.7)261 (26.2)214 (17.9)155 (13.0) College or above2,622 (65.6)519 (50.9)635 (62.1)679 (70.3)789 (79.0) Marital status(%) 0.019 Married2,634 (63.2)584 (58.9)634 (63.5)681 (61.2)735 (69.2) Unmarried1721 (36.9)505 (41.1)455 (36.5)408 (38.8)353 (30.8) Poverty to income ratio (%) < 0.001 ≤ 1.301,073 (16.5)366 (23.5)294 (17.5)225 (13.8)188 (11.3) 1.30–1.85463 (7.9)132 (9.5)134 (9.0)112 (6.6)85 (6.5) > 1.852,485 (69.3)524 (61.7)572 (66.0)656 (72.4)733 (77.1) Missing334 (6.3)67 (5.3)89 (7.6)96 (7.1)82 (5.1) BMI < 0.001 Normal or low weight1,103 (26.2)217 (18.5)287 (24.7)251 (27.7)347 (34.1) Overweight1,467 (34.7)336 (31.5)353 (33.9)394 (40.4)384 (32.6) Obese1,786 (39.1)536 (50.1)449 (41.4)444 (31.9)357 (33.3) Smoking status (%) < 0.001 Never2,496 (55.3)483 (47.7)565 (51.7)662 (57.0)785 (65.1) Former913 (23.3)206 (19.0)240 (22.7)249 (25.6)218 (25.8) Current946 (21.4)399 (33.2)284 (25.7)178 (17.4)85 (9.1) Missing1 (0.0)1 (0.0)000 Alcohol consumption (%) 0.052 No942 (16.2)209 (16.4)206 (14.2)246 (14.5)281 (12.0) Yes3,224 (80.7)838 (79.4)841 (83.1)803 (83.5)742 (76.3) Missing189 (3.1)42 (4.2)42 (2.7)40 (2.0)65 (3.7) Physical activity (%) 0.002 No1,262 (24.3)368 (29.4)327 (25.7)306 (23.1)261 (18.9) Yes3,090 (75.7)720 (70.6)761 (74.3)782 (76.9)827 (81.1) Missing3 (0.0)1 (0.0)1 (0.0)1(0.0)0 Chronic conditions (%) 0.058 02,642 (60.9)590 (57.8)654 (56.5)688 (64.3)710 (64.9) 11,139 (27.1)323 (28.6)299 (30.9)258 (23.4)259 (25.6) 2 or more574 (12.0)176 (13.7)136 (12.6)143 (12.3)119 (9.5) Low muscle mass (%) < 0.001 No3,868 (90.3)933 (83.9)981 (92.4)973 (91.7)981 (92.9) Yes487 (9.7)156 (16.1)108 (7.6)116 (8.3)107 (7.1) Table 1Baseline characteristics of study participants (40 years ≤ age ≤ 59 years) by Healthy Eating Index-2020 from NHANES 2011–2018, n = 4355CharacteristicsHEI-2020 score categoryTotalQ1Q2Q3Q4 P Range of HEI-2020 22.85 to 91.3322.85 to 43.3743.38 to 51.2451.25 to 60.4360.45 to 91.33 HEI-2020 52.10 ± 11.7837.52 ± 4.2447.26 ± 2.2555.74 ± 2.7368.07 ± 6.10< 0.001 Age 50 (45, 55)50 (45, 54)49 (44, 55)50 (45, 55)51 (45, 56)0.004 Sex (%) 0.247 Male2050 (48.6)546 (52.6)544 (49.6)493 (46.5)467 (45.6) Female2305 (51.4)543 (47.4)545 (50.4)596 (53.5)621 (54.4) Ethnicity (%) < 0.001 Mexican American591 (8.5)125 (8.4)140 (8.0)186 (10.1)140 (7.5) Non-Hispanic White1573 (64.8)484 (65.7)431 (67.9)354 (64.0)304 (61.1) Non-Hispanic Black989 (10.9)279 (13.6)264 (11.7)241 (9.3)205 (8.9) Other Race1202 (15.8)201 (12.2)254 (12.4)308 (16.6)439 (22.4) Education (%) < 0.001 Less than high school787 (12.2)245 (17.4)193 (11.7)196 (11.8)144 (7.9) High school graduate946 (22.2)316 (31.7)261 (26.2)214 (17.9)155 (13.0) College or above2,622 (65.6)519 (50.9)635 (62.1)679 (70.3)789 (79.0) Marital status(%) 0.019 Married2,634 (63.2)584 (58.9)634 (63.5)681 (61.2)735 (69.2) Unmarried1721 (36.9)505 (41.1)455 (36.5)408 (38.8)353 (30.8) Poverty to income ratio (%) < 0.001 ≤ 1.301,073 (16.5)366 (23.5)294 (17.5)225 (13.8)188 (11.3) 1.30–1.85463 (7.9)132 (9.5)134 (9.0)112 (6.6)85 (6.5) > 1.852,485 (69.3)524 (61.7)572 (66.0)656 (72.4)733 (77.1) Missing334 (6.3)67 (5.3)89 (7.6)96 (7.1)82 (5.1) BMI < 0.001 Normal or low weight1,103 (26.2)217 (18.5)287 (24.7)251 (27.7)347 (34.1) Overweight1,467 (34.7)336 (31.5)353 (33.9)394 (40.4)384 (32.6) Obese1,786 (39.1)536 (50.1)449 (41.4)444 (31.9)357 (33.3) Smoking status (%) < 0.001 Never2,496 (55.3)483 (47.7)565 (51.7)662 (57.0)785 (65.1) Former913 (23.3)206 (19.0)240 (22.7)249 (25.6)218 (25.8) Current946 (21.4)399 (33.2)284 (25.7)178 (17.4)85 (9.1) Missing1 (0.0)1 (0.0)000 Alcohol consumption (%) 0.052 No942 (16.2)209 (16.4)206 (14.2)246 (14.5)281 (12.0) Yes3,224 (80.7)838 (79.4)841 (83.1)803 (83.5)742 (76.3) Missing189 (3.1)42 (4.2)42 (2.7)40 (2.0)65 (3.7) Physical activity (%) 0.002 No1,262 (24.3)368 (29.4)327 (25.7)306 (23.1)261 (18.9) Yes3,090 (75.7)720 (70.6)761 (74.3)782 (76.9)827 (81.1) Missing3 (0.0)1 (0.0)1 (0.0)1(0.0)0 Chronic conditions (%) 0.058 02,642 (60.9)590 (57.8)654 (56.5)688 (64.3)710 (64.9) 11,139 (27.1)323 (28.6)299 (30.9)258 (23.4)259 (25.6) 2 or more574 (12.0)176 (13.7)136 (12.6)143 (12.3)119 (9.5) Low muscle mass (%) < 0.001 No3,868 (90.3)933 (83.9)981 (92.4)973 (91.7)981 (92.9) Yes487 (9.7)156 (16.1)108 (7.6)116 (8.3)107 (7.1) Baseline characteristics of study participants (40 years ≤ age ≤ 59 years) by Healthy Eating Index-2020 from NHANES 2011–2018, n = 4355 Associations between HEI-2020 and low muscle mass in different models Logistic regression models were used to examine the association between HEI-2020 score and low muscle mass. HEI-2020 score for each quartile was negatively associated with the risk of developing low muscle mass, with significant results observed in all three models. After adjusting socio-demographic characteristics and behavioral factors, the odds ratio of the HEI-2020 score for low muscle mass was reduced in Model 3 compared to Model 1 and Model 2. In Model 3, individuals in the highest quartile of the HEI-2020 score had a 65% lower risk of low muscle mass (OR: 0.35, 95% CI: 0.21–0.58) compared to those in the lowest quartile. Furthermore, a linear trend was noted in all three models (Table 2). Figure 2 displayed RCS curve, demonstrating a negative linear correlation between HEI-2020 score and low muscle mass (P for overall ≤0.01, P for nonlinear = 0.06), and the effect of the HEI-2020 on reducing low muscle mass gradually slowed down after the HEI-2020 score exceeded 50. Table 2Associations between HEI-2020 and low muscle mass in different modelsVariableModel 1 P Model 2 P Model 3 P OR (95%CI)OR (95%CI)OR (95%CI)Q1111Q20.43 (0.30–0.62)< 0.0010.42 (0.28–0.64)< 0.0010.42 (0.27–0.65)< 0.001Q30.48 (0.32–0.70)< 0.0010.44 (0.28–0.69)0.0010.42 (0.26–0.68)0.001Q40.40 (0.26–0.62)< 0.0010.37 (0.23–0.61)< 0.0010.35 (0.21–0.58)< 0.001P for trend< 0.001< 0.001< 0.001Notes: OR odds ratio, CI confidence intervalQ1 to Q4: the 1 st − 4th quartiles of HEI-2020 score respectivelyModel 1: unadjusted, Model 2: adjusted for socio-demographic characteristics (age, sex, ethnicity, education, economic status and marital status), Model 3: adjusted for Model 2 covariates and behavioral factors (smoking status, alcohol consumption, physical activity, and the number of chronic conditions) Table 2Associations between HEI-2020 and low muscle mass in different modelsVariableModel 1 P Model 2 P Model 3 P OR (95%CI)OR (95%CI)OR (95%CI)Q1111Q20.43 (0.30–0.62)< 0.0010.42 (0.28–0.64)< 0.0010.42 (0.27–0.65)< 0.001Q30.48 (0.32–0.70)< 0.0010.44 (0.28–0.69)0.0010.42 (0.26–0.68)0.001Q40.40 (0.26–0.62)< 0.0010.37 (0.23–0.61)< 0.0010.35 (0.21–0.58)< 0.001P for trend< 0.001< 0.001< 0.001Notes: OR odds ratio, CI confidence intervalQ1 to Q4: the 1 st − 4th quartiles of HEI-2020 score respectivelyModel 1: unadjusted, Model 2: adjusted for socio-demographic characteristics (age, sex, ethnicity, education, economic status and marital status), Model 3: adjusted for Model 2 covariates and behavioral factors (smoking status, alcohol consumption, physical activity, and the number of chronic conditions) Associations between HEI-2020 and low muscle mass in different models Notes: OR odds ratio, CI confidence interval Q1 to Q4: the 1 st − 4th quartiles of HEI-2020 score respectively Model 1: unadjusted, Model 2: adjusted for socio-demographic characteristics (age, sex, ethnicity, education, economic status and marital status), Model 3: adjusted for Model 2 covariates and behavioral factors (smoking status, alcohol consumption, physical activity, and the number of chronic conditions) Fig. 2RCS curve of the relationship between HEI-2020 and low muscle mass. RCS regression was adjusted for all covariates, including age, sex, ethnicity, education, economic status, marital status, smoking status, alcohol consumption, physical activity, and the number of chronic conditions. RCS: restricted cubic spline; OR: odds ratio, CI: confidence interval RCS curve of the relationship between HEI-2020 and low muscle mass. RCS regression was adjusted for all covariates, including age, sex, ethnicity, education, economic status, marital status, smoking status, alcohol consumption, physical activity, and the number of chronic conditions. RCS: restricted cubic spline; OR: odds ratio, CI: confidence interval Associations between HEI-2020 components and low muscle mass in different models Figure 3 illustrated that 6 among the 13 components of HEI-2020 components were significantly associated with low muscle mass across all three models. Within the adequacy components, total fruits, whole fruits, total vegetables, greens and beans, seafood and plant proteins, fatty acids exhibited inverse associations with low muscle mass, with Model 3 odds ratios of 0.47 (95%CI: 0.31–0.70), 0.50 (95%CI: 0.32–0.78), 0.41 (95%CI: 0.28–0.60), 0.46 (95%CI: 0.30–0.70), 0.37 (95%CI: 0.26–0.55) and 0.58 (95%CI: 0.37–0.93) respectively. Regarding the moderation components, a lower intake of added sugars was associated with a roughly 40% reduction in the odds of developing low muscle mass (Model 3: OR: 0.59, 95% CI: 0.38–0.90). Fig. 3Associations between HEI-2020 components and low muscle mass in different models. OR: odds ratio. CI: confidence interval. The OR is calculated for Q4 compared to Q1. Q1 to Q4: the 1 st − 4th quartiles of HEI-2020 score respectively. Model 1: unadjusted, Model 2: adjusted for socio-demographic characteristics (age, sex, ethnicity, education, economic status and marital status), Model 3: adjusted for Model 2 covariates and behavioral factors (smoking status, alcohol consumption, physical activity, and the number of chronic conditions) Associations between HEI-2020 components and low muscle mass in different models. OR: odds ratio. CI: confidence interval. The OR is calculated for Q4 compared to Q1. Q1 to Q4: the 1 st − 4th quartiles of HEI-2020 score respectively. Model 1: unadjusted, Model 2: adjusted for socio-demographic characteristics (age, sex, ethnicity, education, economic status and marital status), Model 3: adjusted for Model 2 covariates and behavioral factors (smoking status, alcohol consumption, physical activity, and the number of chronic conditions) Mediating role of BMI The result of mediation analysis presented that the BMI exerted a substantial mediating effect on the association between HEI-2020 and low muscle mass. Both the indirect effect of BMI and the direct effect of HEI-2020 on low muscle mass were statistically significant, indicating that BMI partially mediated the association with a mediation proportion of 33.1% (Fig. 4). Table S4 presented the mediation effects of BMI between HEI-2020 and low muscle mass for each stratum. Except among Non-Hispanic Black, significant mediation effects were observed in all socio-demographic subgroups with the mediation proportion ranged from 18% to 45%. Within each stratum of socio-demographic characteristics, the mediation proportion of BMI was higher among males (37.8%), adults aged 50–59 (42.1%), Non-Hispanic White (36.8%), married individuals (39.0%), those with less than high school education (40.6%), and populations with poverty-to-income ratios > 1.85 (44.0%). Fig. 4Mediation effects of BMI on the association between HEI-2020 and low muscle mass. Outcome: low muscle mass; mediator: BMI. Adjusted for all covariates (age, sex, ethnicity, education, economic status, marital status, smoking status, alcohol consumption, physical activity, and the number of chronic conditions). ***P <0.001 Mediation effects of BMI on the association between HEI-2020 and low muscle mass. Outcome: low muscle mass; mediator: BMI. Adjusted for all covariates (age, sex, ethnicity, education, economic status, marital status, smoking status, alcohol consumption, physical activity, and the number of chronic conditions). ***P <0.001 Stratified analysis The Table S5 revealed the outcomes of stratified analysis that a higher HEI-2020 score was more strongly associated with reduced risk of low muscle mass among females, unmarried individuals and those aged 50–59 years. Across different racial groups, higher HEI-2020 score notably mitigated the risk of low muscle mass solely among non-Hispanic white and other races. After stratification by education and economic status, it was found that the association between the HEI-2020 and low muscle mass was not significant among people with less than a high school education and a poverty to income ratio of 1.30 or lower. Sensitivity analysis Sensitivity analysis were performed to evaluate the potential influence of missing data and outliers on the findings, with results supporting the robustness of the primary findings. After excluding all missing values (Tables S6-S8) and excluding the top and bottom 1% of BMI values (Tables S12-S14), all outcomes remained consistent with the main analysis. When excluding individuals with extreme obesity (BMI ≥40 kg/m²) or severe underweight (BMI <16.5 kg/m²), the association between HEI-2020 and low muscle mass (Table S9), as well as the mediating effect of BMI (Table S11), were consistent with the primary results, but the associations of fatty acids (OR: 0.64, 95% CI: 0.36–1.12) and added sugars (OR: 0.61, 95% CI: 0.36–1.02) with low muscle mass became non-significant (Table S10). Discussion This study found that Americans generally consume approximately 50% of the recommended nutrients amounts and individuals with a higher HEI-2020 score have a significantly reduced risk of low muscle mass, supporting the importance of a balanced diet in maintaining muscle health. Analysis of dietary components indicated that higher intake of vegetables, fruits, greens, beans, seafood and plant-based proteins, and fatty acids, as well as lower consumption of added sugars, were associated with a decreased risk of low muscle mass. Moreover, BMI was identified as a partial mediator between HEI-2020 and muscle mass. The impact of dietary quality on muscle mass varied across different demographic subgroups in this study. The principal findings of this study found that participants in the highest quartile of HEI-2020 score had a 65% lower risk of developing low muscle mass compared to those in the lowest quartile. This suggests that adherence to the DGA may help in the prevention of low muscle mass. The DGA undergoes an evidence-based review and update every five years, and the 2020–2025 edition is notable for being the first to include recommendations based on life stages, promoting a healthy diet throughout the life cycle [15, 16]. Our results align with existing literature demonstrating that higher HEI scores are associated with a reduced risk of several adverse health conditions, such as accelerated aging, sleep disorders, and depression [26, 37, 38]. Furthermore, evidence from various countries supports that higher dietary quality in accordance with current nutritional guidelines, such as the Japanese Food Guide Spinning Top (JFG-ST), Mediterranean Diet, and Australian Recommended Food, is beneficial for preserving muscle mass across diverse populations [39–41]. The muscle mass-preserving effects of a healthy diet may be attributed to different food components, with potential biological mechanisms including antioxidant, anti-inflammatory, acid-base balance and beneficial gut microbiota [19]. Vegetables and fruits are rich in antioxidants including vitamins A, C, E, and carotenoids, which may protect muscle tissue from oxidative damage by eliminating free radicals [42, 43]. In addition, as alkaline foods, they might help slow down the degradation of muscle and bone tissue by neutralizing the effect of high-acid diet [44], and it has been reported that such a diet improves muscle mass indices in healthy women [45]. Research showed that consuming vegetables and fruits could enhance muscle strength and reduce the risk of sarcopenia, however, these outcomes were not consistent when comparing men and women [46]. Additionally, pulses (beans, peas, and lentils) provide various antioxidants, including hydrosoluble (such as organic acids, phenolic compounds, minerals, phytic acid) and liposoluble (such as tocopherols and carotenoids). This fiber content contributes to metabolic health by stabilizing blood glucose, modulating insulin response, and improving lipid profiles [47, 48]. Collectively, these mechanisms may aid in weight management and reduce fat accumulation, thereby preserving muscle health [47, 48]. Study revealed that adults consuming bean dietary pattern tended to have lower BMIs, reduced body weight and smaller waist circumferences [49]. Pulses also serve as a rich source of protein containing diverse amino acids like lysine, leucine, glutamic acid, which positively contribute to muscle homeostasis [50, 51]. Proteins and amino acids are powerful interventions for muscle nutrition and the maintenance of lean body mass. Intake of protein exceeding the Recommended Dietary Allowance (RDA) is correlated with improved body function and a lower sarcopenia risk, and an intake of 1.5 g protein/kg/day appears to be a reasonable target for the older adults [51, 52]. However, this study found that only seafood and plant proteins beneficial for muscle quality. Although some studies have suggested that animal protein is more effective than plant protein at stimulating muscle protein synthesis due to its superior digestibility and bioavailability, it is noteworthy that ascorbic acid from fruits and vegetables can enhance the bioavailability of plant-based proteins [13, 53]. For instance, one study confirmed that while both sources increased lean body mass, the effect was more pronounced with animal protein [13]. Dairy proves to be a great source of high-quality proteins, and a systematic review and meta-analysis indicated that adequate intake of milk protein would boost muscle mass in middle-aged and older individuals [54], a pattern not observed in our study. This discrepancy may be explained by the lack of a significant difference in dairy consumption between the groups in our study—likely due to the widespread accessibility and convenience of dairy products, which leads to a baseline level of intake across the population [55]. Furthermore, research indicated that supplementing with milk protein in conjunction with resistance training could have a more beneficial effect on muscle mass and function [56], but the role of these factors was not fully considered in this study. The inclusion of only individuals aged 40–59 years in our study may also contribute to the heterogeneity of the results. Fatty acids are likely to increase muscle mass and improve physical performance by improving mitochondrial functionality and lipid profiles, mitigating inflammatory responses, supporting cellular differentiation, and modulating cell death pathways [57]. Omega-3(ω−3) fatty acids are widely well-studied classes of fatty acids known for their protective effects on muscle mass; supplementation with more than 2 g/day of ω−3 fatty acids was associated with an increase in muscle mass of 0.33 kg in older adults [58]. In contrast, high intake of added sugars has been linked to numerous detrimental health outcomes, including increased oxidative stress, protein glycation, inflammation, dyslipidemia, and insulin resistance, which may negatively impact muscle metabolism and increase the risk of muscle atrophy and functional decline [59]. Some prospective studies have also indicated that higher added sugar intake is associated with an increased risk of reduced handgrip strength and muscle weakness in middle-aged and older individuals [60, 61]. Growing evidence also suggests that the gut microbiota plays a potential role in muscle health. Studies indicate that probiotic supplementation can improve muscle mass [62, 63], whereas malnutrition disrupts microbial balance [64]. Therefore, a healthy diet may preserve muscle mass by promoting a beneficial gut microbiome. The mediation analysis conducted in this study indicated that BMI exerted a partial mediating effect of 33.1% between HEI-2020 and low muscle mass. A healthy diet influences weight and body composition, which, in turn, affects BMI, an indirect indicator of obesity [65]. In this study, individuals with higher BMI had a higher prevalence of low muscle mass, which was consistent with the findings of previous study [8]. BMI has been identified as an independent predictor of poor muscle quality [6]. The coexistence of low muscle mass and obesity has become a predominantly prevalent feature in older populations [66]. On the one hand, age-related changes in body composition, characterized by a progressive decline in muscle mass that directly promotes fat accumulation through reduced total energy expenditure; on the other hand, it is related to pathophysiological processes such as oxidative stress, chronic inflammation, insulin resistance, mitochondrial dysfunction and so on, which synergistically contributes to decreased muscle mass and function and increased adipose tissue [66, 67]. While malnutrition is a risk factor for low muscle mass, maintaining appropriate body weight may be equally prioritized alongside healthy dietary practices for low muscle mass prevention. Given the differential mediation proportion of BMI across population subgroups, particular attention to BMI management is warranted, especially in males, adults aged 50–59, Non-Hispanic White, married individuals, those with lower education level and higher economic status. However, it is important to note that weight loss can also lead to a decrease in muscle quality, necessitating efforts to minimize muscle loss while managing weight through scientifically informed strategies [68]. Stratified analysis revealed that the protective effect of a HEI-2020 on muscle mass varied across demographic subgroups. Notably, HEI-2020 appeared to be more effective in mitigating low muscle mass in women compared to men, possibly because women experience a less pronounced decline in muscle mass with age than their male counterparts [69]. When comparing the 50–59 age group to the 40–49 age group, the older cohort exhibited a more significant risk of reducing low muscle mass in terms of HEI-2020 score. This may be because older adults are more susceptible to muscle loss and are more likely to adopt healthy dietary patterns [70]. The disparities observed among different ethnicity groups may be attributed to varying dietary cultures, dietary preferences and dietary practices [71–73]. Furthermore, no association was found between HEI-2020 and low muscle mass among individuals with lower levels of education and income, likely due to limitations in educational and economic resources that hinder their ability to acquire nutritional knowledge and restrict their food choices [74]. Consequently, this demographic may be more inclined to choose low-cost, nutritionally inferior food options, potentially compromising their dietary quality. Contrary to the common belief that married individuals have superior dietary habits and health [75, 76], this study found that the protective effect of marriage against low muscle mass, as measured by the HEI-2020, was less pronounced than in unmarried individuals. We hypothesize that this attenuation could be due to lifestyle factors associated with marriage—such as a tendency toward higher BMI and lower physical activity [76]—which may offset the advantages of a superior diet. This study underscores the role of a healthy diet in preserving muscle mass, specifically in middle-aged adults, and explores the underlying mechanism through which BMI may mediate this relationship. The beneficial effect of a HEI-2020 on muscle mass may stem from providing a more balanced diet, maximizing the effectiveness of various foods through their combination, and creating an optimal environment for muscle health through antioxidant, anti-inflammatory, acid-base balance, and beneficial gut microbiota mechanisms. This highlights the significance of taking preventive measures in midlife to prevent muscle mass decline, and also underscores the potential health benefits of using dietary approaches to improve muscle health. This study utilized high-quality data, the latest version of HEI-2020, and various statistical methods to ensure the reliability and representativeness of the research results. However, we acknowledge our study have some limitations. First, dietary intake was assessed via 24-hour recalls, which are susceptible to recall bias and may not fully represent participants’ habitual diets. Second, the cross-sectional nature of the analysis prevents the establishment of causality between diet and muscle mass or a definitive mediation pathway for BMI. Third, the findings are based solely on U.S. population data, which may limit their applicability to populations in other regions or countries. Fourth, this study only included a population aged 40–59, which can’t provide evidence for other age populations, such as the younger and older population. Finally, despite adjusting for potential confounders in our models, residual confounding may persist due to unmeasured or unknown confounders. Conclusions In conclusion, a higher HEI-2020 score is associated with a 65% reduced risk of low muscle mass among middle aged populations. The proportion of BMI mediating the association between HEI-2020 and low muscle mass is 33.1% in the total population and range from 18% to 45% in populations with different sociodemographic characteristics. It is recommended to follow the healthy dietary patterns to decrease the risk of low muscle mass, particularly by ensuring adequate intake of vegetables, fruits, beans, high-quality proteins, and fatty acids, while limiting the consumption of added sugars. Concurrently, focusing on weight management is also conducive to muscle health and helps prevent the onset of low muscle mass. Supplementary Information Additional file 1. Additional file 1.