Purpose – Children's eating habits are influenced by numerous social and individual factors. The present study aimed to evaluate the connection between nutrition knowledge of children and their eating habits as well as their attitudes towards healthy eating habits. Design/methodology/approach – The research study included 630 11-year-old children from 27 randomly selected Slovenian schools. During the research, children attended the sixth grade of the nine-year elementary school and on average were subject to 38.6 h of mandatory nutritional contents, which are planned in the curriculum of home economics. At the end of the school year, nutrition knowledge was checked with a knowledge test consisting of 27 questions. Considering the achieved results, children were classified into three knowledge categories: low, fairly good, and good nutrition knowledge. Children's eating habits were assessed with a food-frequency questionnaire, while the five-degree Likert scale was used to assess their attitudes to healthy eating habits. Differences in children's eating habits and attitudes in reference to the category of knowledge were determined through analysis of variance. Findings – The results demonstrated that children with better nutrition knowledge have healthier eating habits and a more positive attitude towards them than children with poor nutrition knowledge. Originality/value – The study results demonstrate the link between children's nutrition knowledge and attitudes on the one hand and eating habits on the other which justifies the importance of providing formal and informal nutrition education to children.