A comprehensive analytical investigation of the sorption behaviour of a large selection of over-the-counter, prescribed pharmaceuticals and illicit drugs to agricultural soils and freeze-dried digested sludges is presented. Batch sorption experiments were carried out to identify which compounds could potentially concentrate in soils as a result of biosolid enrichment. Analysis of aqueous samples was carried out directly using liquid chromatography-tandem mass spectrometry (LC-MS/MS). For solids analysis, combined pressurised liquid extraction and solid phase extraction methods were used prior to LC-MS/MS. Solid–water distribution coefficients (Kd) were calculated based on slopes of sorption isotherms over a defined concentration range. Molecular descriptors such as log P, pKa, molar refractivity, aromatic ratio, hydrophilic factor and topological surface area were collected for all solutes and, along with generated Kd data, were incorporated as a training set within a developed artificial neural network to predict Kd for all solutes within both sample types. Therefore, this work represents a novel approach using combined and cross-validated analytical and computational techniques to confidently study sorption modes within the environment. The logarithm plots of predicted versus experimentally determined Kd are presented which showed excellent correlation (R2 > 0.88), highlighting that artificial neural networks could be used as a predictive tool for this application. To evaluate the developed model, it was used to predict Kd for meclofenamic acid, mefenamic acid, ibuprofen and furosemide and subsequently compared to experimentally determined values in soil. Ratios of experimental/predicted Kd values were found to be 1.00, 1.00, 1.75 and 1.65, respectively.