Abstract Background Human papillomavirus (HPV) infection is associated with anal cancers and is more prevalent in gay, bisexual, and men who have sex with men (gbMSM), partly due to their vulnerability to HIV infection. Baseline HPV genotype distributions and risk factors can inform the design of next‐generation HPV vaccines to prevent anal cancer. Methods A cross‐sectional study was conducted among gbMSM receiving care at a HIV/STI clinic in Nairobi, Kenya. Anal swabs were genotyped using a Luminex microsphere array. Multiple logistic regression methods were used to identify risk factors for four HPV outcomes (any HPV, any HR‐HPV, and 4‐ and 9‐valent vaccine‐preventable HPVs). Results Among 115 gbMSM, 51 (44.3%) were HIV‐infected. Overall HPV prevalence was 51.3%; 84.3% among gbMSM living with HIV and 24.6% among gbMSM without HIV (p