BACKGROUND: Serosorting, the practice of seeking to engage in unprotected anal intercourse with partners of the same HIV status as oneself, has been increasing among men who have sex with men. However, the effectiveness of serosorting as a strategy to reduce HIV risk is unclear, especially since it depends on the frequency of HIV testing. METHODS: We estimated the relative risk of HIV acquisition associated with serosorting compared with not serosorting by using a mathematical model, informed by detailed behavioral data from a highly studied cohort of gay men. RESULTS: We demonstrate that serosorting is unlikely to be highly beneficial in many populations of men who have sex with men, especially where the prevalence of undiagnosed HIV infections is relatively high. We find that serosorting is only beneficial in reducing the relative risk of HIV transmission if the prevalence of undiagnosed HIV infections is less than approximately 20% and approximately 40%, in populations of high (70%) and low (20%) treatment rates, respectively, even though treatment reduces the absolute risk of HIV transmission. Serosorting can be expected to lead to increased risk of HIV acquisition in many settings. In settings with low HIV testing rates serosorting can more than double the risk of HIV acquisition. CONCLUSIONS: Therefore caution should be taken before endorsing the practice of serosorting. It is very important to continue promotion of frequent HIV testing and condom use, particularly among people at high risk.