In this study, 6th, 7th, and 8th grade students' knowledge of history of mathematics and their attitudes and beliefs towards the use of history of mathematics in school mathematics were investigated according to gender and grade level. Moreover, a possible statistical relationship was investigated between the addressed knowledge and attitudes and beliefs. Data was collected through Knowledge of History of Mathematics Test and Attitudes and Beliefs toward using History of Mathematics in School Mathematics Questionnaire, which was specifically adopted for this study, from 499 students in 6 middle schools in Ankara via clustered-random sampling. The descriptive studies revealed that most of the students stated that history of mathematics was not given a place in their classes and that they did not follow publications related to history of mathematics. On the other hand, the students' knowledge of history of mathematics was insufficient in general. Their attitudes and beliefs towards the use of history of mathematics in school mathematics were close to positive, but their ideas on this issue did not maturate yet. Two-way analyses of variance indicated significant differences in students' knowledge of history of mathematics and attitudes and beliefs towards using history of mathematics favoring females and some upper grades. A significant relationship was found between the knowledge and attitudes and beliefs through Pearson's product-moment correlation coefficient.