Matcha, made from different tea leaves as raw material, exhibits diverse aromas and flavors. Therefore, there is an urgent need for a rapid, non-destructive method to assess the quality of matcha to ensure that these different characteristics are accurately assessed without compromising the integrity of the product. In this study, hyperspectral imaging technology (HSI) combined with machine learning methods enabled the first visual in situ assessment of matcha quality. The physicochemical contents of matcha were determined chemically. Qualitative and quantitative detection models for different types and grades were developed using HSI (containing Vis-NIR and NIR band). The results showed that hyperspectral data in the Vis-NIR were better than in the NIR band. The accuracy of XGBoost in modelling the classification of matcha grades reached 98.10 %. After feature selection using the random forest (RF) method, partial least squares regression (PLSR) was built to predicted the quality of matcha, which showed high prediction accuracy (test set Rp2 > 0.95). The model uses HSI to visually visualize spatial variations in constitutions (catechins, free amino acids, caffeine, soluble proteins, and soluble sugars) to show compositional differences between different types of matcha, providing a rapid non-destructive method for comprehensive assessment of matcha quality.