ObjectiveTo assess the associations between self-efficacy, nutrition literacy and eating behavior, and to examine if nutrition literacy mediates the relationship between self-efficacy and eating behavior in young tuberculosis patients. MethodsThis cross-sectional study used a convenience sampling strategy to select 230 young tuberculosis patients at the Second Hospital of Nanjing (Public Health Medical Center of Nanjing), China, from June 2022 to August 2022. The data were collected using a demographic data form, the Eating Behavior Scale, the Food and Nutrition Literacy Questionnaire and the Tuberculosis Self-Efficacy Scale. Descriptive statistics, Pearson bivariate correlation analysis, Pearson partial correlation analysis, hierarchical multiple regression, and mediation analysis were conducted in the study. ResultsThe mean self-efficacy score for young tuberculosis patients was 92.56 (SD = 9.89, range = 21 ∼ 105). The average nutrition literacy score for young tuberculosis patients was 68.24(SD = 6.75, range = 0 ∼ 100). The bivariate correlation analysis and partial correlation analysis found that self-efficacy was positively correlated with nutrition literacy (P < 0.01). The regression analysis showed that self-efficacy (F = 5.186, β = 0.233, P < 0.001)and nutrition literacy (F = 7.749, β = 0.545, P < 0.001) significantly predicted eating behavior. The three dimensions of nutrition literacy including nutritional knowledge (mediation effect ratio = 13.1%, 95% CI = − 0.089; −0.005), preparing food (mediation effect ratio = 17.4%, 95 %CI = 0.011; 0.077) and eating (mediation effect ratio = 54.7%, 95 %CI = 0.070; 0.192) mediated the relationship between self-efficacy and eating behavior in young tuberculosis patients. ConclusionNutrition literacy mediatedtherelationship between self-efficacy and eating behavior. To promote healthy eating behavior among young tuberculosis patients, interventions aimed at improving self-efficacy and nutrition literacy should be conducted.