IntroductionAlthough strong scientific evidence of the efficacy and effectiveness of treatment‐as‐prevention (TasP) is available, full endorsement of the “Undetectable = Untransmittable” (U = U) and “zero‐risk” messages could be improved. Increasing knowledge about HIV transmission, prevention and treatment is a critical component of care efforts. The study assessed knowledge of HIV transmission and prevention strategies, and the perceived accuracy of the slogan U = U among sexual and gender minorities (SGM) in Brazil.MethodsCross‐sectional web‐based survey targeting adult SGM living in Brazil (2021−2022) recruited on social media and dating apps. We used the 12‐item HIV Knowledge Assessment (HIV‐KA) questionnaire to assess HIV knowledge, three items of which address pre‐exposure prophylaxis (PrEP), post‐exposure prophylaxis and TasP. Perceived accuracy of the U = U slogan was assessed with the question: “With regards to HIV‐positive individuals transmitting HIV through sexual contact, how accurate do you believe the slogan U = U is?”. We a priori grouped the study population into three mutually exclusive groups: people living with HIV (PLHIV), HIV negative and HIV unknown. We used logistic regression models to assess factors associated with high HIV knowledge and perception of the U = U as completely accurate.ResultsOf 50,222 individuals accessing the questionnaire, 23,981 were included: 5071 (21.0%) PLHIV, 17,257 (71.5%) HIV negative and 1653 (6.9%) HIV unknown. The proportion of participants with high knowledge was significantly higher for PLHIV and HIV negative (48.1% and 45.5%, respectively) compared to 26.1% of HIV unknown. More PLHIV perceived U = U as completely accurate (80.4%), compared to 60.0% of HIV negative and 42.9% of HIV unknown. HIV knowledge correlates with perceived accuracy of the U = U slogan across all groups. Higher HIV knowledge was associated with higher income and education regardless of HIV status. Among HIV‐negative participants, PrEP awareness and use were associated with higher knowledge and accurate perception of the U = U slogan.ConclusionsOur findings show that HIV knowledge and perceived accuracy of U = U are strongly correlated, that knowledge differs according to HIV status, and that poor socio‐economic is linked to poor knowledge among SGM from Brazil. Educational strategies regarding TasP, U = U and zero risk targeting socio‐economically vulnerable populations are urgent in Brazil.