We report the frequency of previous HIV testing at baseline in men who have sex with men (MSM) who enrolled in an HIV self-testing (HIVST) randomized controlled trial [an HIV self-testing public health intervention (SELPHI)]. Criteria for enrolment were age ≥ 16years, being a man (including trans men) who ever had anal intercourse (AI) with a man, not being known to be HIV positive and having consented to national HIV database linkage. Using online survey baseline data (2017-2018), we assessed associations with never having tested for HIV and not testing in the previous 6months, among men who reported at least two recent condomless AI (CAI) partners. A total of 10111 men were randomized; the median age was 33years [interquartile range (IQR) 26-44 years], 89% were white, 20% were born outside the UK, 0.8% were trans men, 47% were degree educated, and 8% and 4% had ever used and were currently using pre-exposure prophylaxis (PrEP), respectively. In the previous 3months, 89% reported AI and 72% reported CAI with at least one male partner. Overall, 17%, 33%, 54%, and 72% had tested for HIV in the last 3months, 6months, 12months and 2years, respectively; 13% had tested more than 2years ago and 15% had never tested. Among 3972 men reporting at least two recent CAI partners, only 22% had tested in the previous 3months. Region of residence and education level were independently associated with recent HIV testing. Among current PrEP users, 15% had not tested in the previous 6months. Most men in SELPHI, particularly those reporting at least two CAI partners and current PrEP users, were not testing in line with current UK recommendations. The results of the trial will inform whether online promotion of HIVST addresses ongoing testing barriers.