Many cancer types display sex and age disparity in incidence and outcome. The mutational load of tumours, including melanoma, varies according to sex and age. However, there are no tools to systematically explore if clinical variables such as age and sex determine the genomic landscape of cancer.To establish a mathematical approach using melanoma mutational data to analyze how sex and age shape the tumour genome.We model how age-related (clock-like) somatic mutations that arise during cell division, and extrinsic (environmental ultraviolet light) mutations accumulate in cancer genomes.Melanoma is primarily driven by cell-intrinsic age-related mutations and extrinsic ultraviolet light-induced mutations, and we show these mutation types differ in magnitude, chronology and by sex in the distinct molecular melanoma subtypes. Our model confirms age and sex are determinants of cellular mutation rate, shaping the final mutation composition. We show mathematically for the first time how, similar to non-cancer tissues, melanoma genomes reflect a decline in cell division during ageing. We find clock-like mutations strongly correlate with the acquisition of ultraviolet light-induced mutations, but critically, males present a higher number and rate of cell division-linked mutations.These data indicate the contribution of environmental damage to melanoma likely extends beyond genetic damage to affect cell division. Sex and age determine the final mutational composition of melanoma.