Background: HPV infection is common and may cause cancer among men who have sex with men (MSM). Anal HPV infection (HPV+) was found in 85% of HIV-positive (HIV+) and 59% of HIV-negative (HIV-) MSM in Bangkok, central Thailand. As little is known about HPV in this group in northern Thailand, we studied MSM subgroups comprised of gay men (GM), bisexual men (BM), and transgender women (TGW). Methods: From July 2012 through January 2013, 85 (42.5% of 200) GM, 30 (15%) BM, and 85 (42.5%) TGW who practiced receptive anal intercourse were recruited after informed consent, followed by self-assisted computer interview, HIV testing, and anal swabs for HPV genotyping. Results: Of 197 adequate specimens, the overall prevalence of any HPV was 157 (80%). Prevalence was 89% (76/85) in GM, 48% (14/29) in BM, and 81% (67/83) in TGW. The most common high-risk types were HPV16 (27% of 197), HPV58 (23%), and HPV51 (18%). Prevalence of high-risk types was 74% in 85 GM, 35% in 29 BM, and 71% in 83 TGW. Prevalence of any HPV type, or high-risk type, was 100% and 94%, respectively, among 48 HIV+ MSM, 70% and 54% among 120 HIV- MSM. Of the 197 specimens, 36% (70) had HPV types 16 and/or 18 in the bivalent vaccine, compared to 48% (95) with ≥1 of types 16/18/06/11 in the quadrivalent, 56% (111) for 16/18/31/33/45/52/58 in the 7-valent, and 64% (126) for 16/18/31/33/45/52/58/06/11 in the 9-valent. HIV+, GM, and TGW were independently associated with HPV infection. Conclusions: We found higher rates of both any HPV and high-risk types than previous studies. Among the heretofore unstudied TGW, their equivalent HPV rates were comparable to GM. Current and investigational HPV vaccines could substantially protect GM, BM, and TGW from the serious consequences of HPV infection especially among HIV + MSM.