OBJECTIVES: To describe knowledge, practices, and associated factors of medical students to prevent transmission of tuberculosis (TB) in five medical schools. METHODS: Cross-sectional survey of undergraduate medical students in preclinical and in early and late clinical years. Information was obtained on sociodemographic profile, previous lectures on TB, knowledge about TB transmission, exposure to patients with active pulmonary TB, and use of respiratory protective masks. RESULTS: Among 1 094 respondents, 575 (52.6%) correctly answered that coughing, speaking, and sneezing can transmit TB. Early [adjusted odds ratio = 4.0 (3.0, 5.5)] and late [adjusted odds ratio = 4.2 (3.1, 5.8)] clinical years were associated with correct answers, but having had previous lectures on TB was not. Among those who had previous lectures on TB, the rate of correct answers increased from 42.1% to 61.6%. Among 332 medical students who reported exposure to TB patients, 194 (58.4%) had not used protective masks. More years of clinical experience was associated with the use of masks [adjusted odds ratio = 2.9 (1.4, 6.1)], while knowledge was inversely associated with the use of masks [adjusted odds ratio = 0.4 (0.2, 0.6)]. CONCLUSIONS: Many medical students are not aware of the main routes of TB infection, and lectures on TB are not sufficient to change knowledge and practices. Regardless of knowledge about TB transmission, students engage in risky behaviors: more than two-thirds do not use a protective mask when examining an active TB case. We suggest innovative, effective active learning experiences to change this scenario.