Gardasil is the brand name of the human papillomavirus (HPV) vaccine. It's used to protect against cervical, anal, and vaginal cancers that are caused by HPV. It's also used to prevent genital warts caused by the virus. Gardasil works by stimulating the immune system to attack HPV.