There is a growing interest in studying the nutritional effects of complex diets. For such studies, measurement of dietary compliance is a challenge because the currently available compliance markers cover only limited aspects of a diet. In the present study, an untargeted metabolomics approach was used to develop a compliance measure in urine to distinguish between two dietary patterns. A parallel intervention study was carried out in which 181 participants were randomized to follow either a New Nordic Diet (NND) or an Average Danish Diet (ADD) for 6 months. Dietary intakes were closely monitored over the whole study period, and 24 h urine samples as well as weighed dietary records were collected several times during the study. The urine samples were analyzed by UPLC-qTOF-MS, and a partial least-squares discriminant analysis with feature selection was applied to develop a compliance model based on data from 214 urine samples. The optimized model included 52 metabolites and had a misclassification rate of 19% in a validation set containing 139 samples. The metabolites identified in the model were markers of individual foods such as citrus, cocoa-containing products, and fish as well as more general dietary traits such as high fruit and vegetable intake or high intake of heat-treated foods. It was easier to classify the ADD diet than the NND diet probably due to seasonal variation in the food composition of NND and indications of lower compliance among the NND subjects. In conclusion, untargeted metabolomics is a promising approach to develop compliance measures that cover the most important discriminant metabolites of complex diets.