Abstract Tramadol is an opioid drug metabolised in phase I by cytochrome P450 (CYP) enzymes, of which CYP2D6 is mainly responsible for the O-demethylation of tramadol, but is not involved in N-demethylation. Defects in the genes encoding drug metabolising enzymes (DMEs) may lead to adverse drug effects, even to death. To aid interpretation of the forensic toxicology results, we studied how the genetic variation of the CYP2D6 gene is reflected in tramadol metabolite ratios found in post-mortem samples. In 33 Finnish autopsy cases where tramadol was found, we analysed both the CYP2D6 genotype and the concentrations of tramadol and its metabolites O- and N-demethyltramadol. As expected, we found a correlation between the number of functional CYP2D6 alleles and the ratio of tramadol to O-demethyltramadol. We also found a correlation between the number of functional alleles and the ratio of tramadol to N-demethyltramadol. This can be explained by the complementary nature of the two main tramadol demethylation pathways. No known CYP2D6 inhibitors were associated with exceptional metabolic ratios. Furthermore, no accidental tramadol poisonings were associated with a defective CYP2D6 gene. Our results on the tramadol are among the first to demonstrate that genetic variation in drug metabolising enzymes can be analysed in post-mortem blood, and that it correlates well with the parent drug to metabolite ratios. The results also suggest that genetic factors play, in general, a dominant role over other factors in the metabolism of individual drugs.