We simulated the frequency of tuberculosis infection in healthcare workers in order to classify the risk of TB transmission for nine hospitals in Medellín, Colombia. We used a risk assessment approach to estimate the average number of infections in three risk groups of a cohort of 1082 workers exposed to potentially infectious patients over 10- and 20-day periods. The risk level of the hospitals was classified according to TB prevalence: two of the hospitals were ranked as being of very high priority, six as high priority and one as low priority. Consistent results were obtained when the simulation was validated in two hospitals by studying 408 healthcare workers using interferon gamma release assays and tuberculin skin testing. The latent infection prevalence using laboratory tests was 41% [95% confidence interval (CI) 34·3–47·7] and 44% (95% CI 36·4–51·0) in those hospitals, and in the simulation, it was 40·7% (95% CI 32·3–49·0) and 36% (95% CI 27·9–44·0), respectively. Simulation of risk may be useful as a tool to classify local and regional hospitals according to their risk of nosocomial TB transmission, and to facilitate the design of hospital infection control plans.