N-nitrosodimethylamine (NDMA) and the industrial solvent, N,N-dimethylformamide (DMF), are both probable human carcinogens that have been detected in pharmaceutical drug products like metformin, which is used to treat type II diabetes. Some lots of metformin drug products have exceeded the United States Food and Drug Administration (FDA) daily allowable intake limit for NDMA, while the presence of DMF has been detected at several orders of magnitude higher than NDMA. A recent study found that a low abundance isotope of DMF interferes with NDMA quantification by using a unique subset of LC-MS instruments capable of high mass resolution. In this study, an LC-HRMS method is developed that chromatographically separates NDMA from DMF in metformin drug products to eliminate interference. The method can detect nitrosamines and DMF under the current regulatory guidance for industry and provides a solution for simultaneously quantifying nitrosamines and DMF for a broad range of LC-MS instruments.