Defective coffee beans (DCB) are one of the main reasons for poor coffee quality. In the current research, chemical difference of three common DCB including sour beans (SCB), black beans (BCB), and mold beans (MCB) were clarified using 1H qNMR method and compared with that of non-defective beans (NDCB). The results indicated that DCB has lower sugar and lipid content compared to NDCB, yet it boasts a higher acetate concentration. The 1H NMR from water-soluble content was shown to be more effective than that of oil fraction for qualitative of DCB blends, regardless of whether partial least squares discriminant analysis (PLS-DA) or machine learning (ML) algorithms were used. Support vector machine (SVM) was proved to be excellent for distinguishing DCB blends. Finally, a partial least squares regression (PLS) model was built for quantitative analysis of DCB blends. In summary, current research will not only help to reveal the material basis of DCB and their impact on coffee flavor, but also provide feasible strategies for the identification of DCB.