To document determinants of O-demethylation in critically ill (pre)term neonates and infants, tramadol (M) and O-demethyl tramadol (M1) concentrations were quantified in eighty-six 24 h urine collections and 168 plasma samples. A significant correlation of urine log M/M1 (0.98, SD 0.66) and plasma log M/M1 (0.78, SD 0.45) with postmenstrual age (PMA) (r = −0.69 and −0.65) was observed. One-way analysis of variance documented a significant decrease in urine log and plasma log M/M1 with increasing CYP2D6 activity score (F value 11.6 and 22.55). PMA and CYP2D6 activity score determined the urine and plasma log M/M1 (R2 0.59 and 0.64) in a forward multiple regression model. We therefore conclude that PMA and CYP2D6 polymorphisms determined O-demethylation activity in (pre)term neonates and young infants, illustrating the impact of pharmacogenetics on drug metabolism in neonates although a relevant part of the interindividual varaibility remained unexplained. Besides compound-specific relevance, CYP2D6 iso-enzyme specific data on in vivo ontogeny of O-demethylation can contribute to safer and more effective administration of drugs metabolized by the same route in this population.