Many taxa show substantial differences in lifespan between the sexes. However, these differences are not always in the same direction. In mammals, females tend to live longer than males, while in birds, males tend to live longer than females. One possible explanation for these differences in lifespan is the unguarded X hypothesis, which suggests that the reduced or absent chromosome in the heterogametic sex (e.g. the Y chromosome in mammals and the W chromosome in birds) exposes recessive deleterious mutations on the other sex chromosome. While the unguarded X hypothesis is intuitively appealing, it had never been subject to a broad test. We compiled male and female longevity data for 229 species spanning 99 families, 38 orders and eight classes across the tree of life. Consistent with the unguarded X hypothesis, a meta-analysis showed that the homogametic sex, on average, lives 17.6% longer than the heterogametic sex. Surprisingly, we found substantial differences in lifespan dimorphism between female heterogametic species (in which the homogametic sex lives 7.1% longer) and male heterogametic species (in which the homogametic sex lives 20.9% longer). Our findings demonstrate the importance of considering chromosome morphology in addition to sexual selection and environment as potential drivers of sexual dimorphism, and advance our fundamental understanding of the mechanisms that shape an organism's lifespan.