We recruited 510 male sex workers (also referred as 'money boys' (MBs) and 533 other men who have sex with men (MSM) to investigate determinants of recent (last year) HIV testing in Shenzhen, China. Overall, 43% of MBs and 48% of other MSM reported having been tested for HIV in the last year. The most important determinant of testing among MBs was having multiple anal sex partners; among other MSM, the most important determinants were having a homosexual orientation and having a history of sexually transmissible infection. For MBs, education programs are needed to increase their awareness of actual HIV risk. For other MSM, destigmatising programs are needed.