Despite increasing global attention to the national human papillomavirus (HPV) immunization program, this program is controversial in Iran. Evidence indicates that HPV vaccination is not cost-effective in Iran. Using cost-effectiveness analysis for decision-making about public health interventions such as vaccination is controversial because its potential benefits may not fit this framework. This study aimed to evaluate the economic effects of the HPV vaccination by cost–benefit analysis (CBA) using bivalent and quadrivalent in Iran in 2020. We performed a CBA from a societal perspective. We used two approaches of the vaccine’s economic benefits: willingness to pay by discrete choice experiment and cost of illness. Costs only included the vaccine cost. The cost of two doses of bivalent and quadrivalent vaccines were US $29 and the US $151, respectively (US $1 = IRR 42,000). The benefits of bivalent and quadrivalent vaccines were US $ − 432, US $380 per person using the willingness to pay approach, and they were US $7375 and US $6590 thorough cost-of-illness approach. The cost–benefit ratio (CBR) of bivalent and quadrivalent vaccines was − 15.11 and 2.51 by the willingness to pay approach, and 258.12 and 43.51 by the cost of illness approach. This study confirms the benefits of the national bivalent and quadrivalent vaccination programs and provides reliable evidence for policy-makers programming HPV vaccination.