ABSTRACT Groundwater quality is vital for public health and environmental sustainability. As managing large datasets is challenging for traditional methods, this study combines the hidden Markov model (HMM) and the artificial neural network (ANN), a machine learning-based ensemble model to predict groundwater quality in Kanyakumari District, Tamil Nadu, India. In order to train the model, the acquired data is cleaned and normalized. HMM is used to find hidden patterns while the ANN architecture is used to forecast groundwater quality categories. Accuracy, precision, sensitivity, and F1-scores calculation are necessary to evaluate the model's performance. The effectiveness of the approach can be analyzed by k-fold cross-validation scores. The study demonstrates the effectiveness of the HMM–ANN approach in groundwater quality prediction with an accuracy of 97.41%. Thus, the research contributes to groundwater quality assessment by offering a unique methodology that facilitates informed decision-making for water resource management and environmental conservation.