摘要:Abstract Background Despite clear evidence on role of gender in vulnerability and exposure to HIV infection, information on gender-related inequalities in HIV and related factors are rarely documented. The aim of this study was to measure gender inequality in HIV infection and its determinates in Tehran city, the capital of Iran. Methods The study used the data of 20,156 medical records of high-risk people who were admitted to Imam Khomeini Voluntary Counseling and Testing site in Tehran from 2004 to 2018. The Blinder-Oaxaca decomposition was used to quantify the contribution of explanatory variables to the gap in the prevalence of HIV infection between female and male. Results The age-adjusted proportion of HIV infection was 9.45% (95%Cl: 9.02, 9.87). The absolute gap in the prevalence of HIV infection between male and female was 4.50% (95% CI: − 5.33, − 3.70%). The Blinder-Oaxaca decomposition indicated that most explanatory factors affecting the differences in HIV infection were job exposure, drug abuse, history of imprisonment, injection drug, heterosexual unsafe sex, and having an HIV-positive spouse. Conclusion The results can provide evidence for health policymakers to better planning and conducting gender-based preventive and screening programs. Policies aiming at promoting HIV preventive behaviors among male may reduce the gap in HIV infection between female and male in Iran.