It is important to determine the sex of elephants from their samples-faeces from the field or seized ivory-for forensic reasons or to understand population demography and genetic structure. Molecular sexing methods developed in the last two decades have often shown limited efficiency, particularly in terms of sensitivity and specificity, due to the degradation of DNA in these samples. These limitations have also prevented their use with ancient DNA samples of elephants or mammoths. Here we propose a novel TaqMan-MGB qPCR assay to address these difficulties. We designed it specifically to allow the characterization of the genetic sex for highly degraded samples of all elephantine taxa (elephants and mammoths). In vitro experiments demonstrated a high level of sensitivity and low contamination risks. We applied this assay in two actual case studies where it consistently recovered the right genotype for specimens of known sex a priori. In the context of a modern conservation survey of African elephants, it allowed determining the sex for over 99% of fecal samples. In a paleogenetic analysis of woolly mammoths, it produced a robust hypothesis of the sex for over 65% of the specimens out of three PCR replicates. This simple, rapid, and cost-effective procedure makes it readily applicable to large sample sizes.