Direct analysis in real time coupled with high-resolution mass spectrometry (DART-HRMS) followed by multivariate statistical analysis has been successfully applied to infer the sources of heroin samples seized in China. Heroin and organic impurities in samples were detected by DART-HRMS. Partial least squares- discriminant analysis (PLS-DA) and orthogonal PLS-DA (OPLS-DA) models were tested and compared using data for heroin seized from Southeast Asia and Southwest Asia. The OPLS-DA model was used to discover and identify potential organic impurities to distinguish heroin samples from different sources. Niacin, paracetamol, ephedrine, caffeine, hydrocotarnine, lidocaine, morphine, codeine, thebaine, boldine, reticuline, papaverine, codamine, papaveraldine, laudanosine, heroin, N-acetylnorlaudanosine, 3,6-dimethoxy-8-(2-(N-methylacetarnido)ethyl)phenanthren-4-yl acetate, N,O-3,O-6-triacetylnormorphine, noscapine, reticuline diacetate, narceine and four unknowns were detected in our research. Unknown heroin samples were analysed by an established model to determine their sources. The proposed method shows that DART-HRMS combined with multivariate statistical analysis was a simple and effective method for judging the source of heroin. The low-pollution method established in this experiment was suitable for the high-throughput determination of heroin samples and was, simple, fast and accurate. This method, which was used to identify the sources of drugs, is a major innovation in forensic intelligence analysis.