HIV prevention programs in Indonesia continue to be implemented, but public knowledge about HIV remains uneven. Understanding the factors that influence knowledge about HIV is crucial for designing effective education and prevention strategies. This study aims to analyze the relationship between gender, age, and education level with knowledge about HIV among people in East Java. A cross-sectional quantitative study was conducted involving 5,284 respondents. Data were collected through an online survey using a structured questionnaire that was disseminated via social media platforms and networks of health facilities. HIV knowledge was assessed using a set of structured questions designed to measure respondents’ understanding of HIV transmission and prevention. Bivariate and multivariate logistic regression analyses were used to assess the relationship between sociodemographic variables and knowledge about HIV. Educational level was the strongest predictor of HIV knowledge. Respondents with higher education were more than 18 times more likely to have high HIV knowledge compared to those without formal education (OR = 18.537, p = 0.006). Women were significantly less likely than men to have high HIV knowledge(OR = 0.663, p < 0.001). Participants aged 12–25 years were significantly less likely to report HIV prevention behaviour compared with those aged >60 years (OR = 0.640, p = 0.031). Sociodemographic factors significantly influence HIV knowledge in East Java. Strengthening school-based and community-level HIV education is crucial to reducing knowledge gaps and supporting prevention efforts.