Groundwater contamination is a severe problem that deteriorates ecosystems, human health, and plant/animal life. Assessment and Modeling of groundwater quality is a possible solution to tackle this problem. In this study, 449 groundwater samples during the year 2018 in Haryana state, India, were analyzed for thirteen water quality parameters such as pH, Electrical Conductivity (EC), total hardness (TH), Calcium (Ca2+), Magnesium (Mg2+), Sodium (Na+), Potassium (K+), Carbonate (CO32-) and Bicarbonate (HCO3-), Nitrate (NO32-), Chloride (Cl-), Sulphate (SO42-), and Fluoride (F-). Three machine learning techniques, say Generalized linear model (GLM), Distributed random trees (DRF), and Extremely random trees (XRT), were applied to estimate the Water quality index (WQI) for drinking purpose. The prediction performances of these three models are determined by using four error metrics, namely Coefficient of determination (R2), Root Mean Square Error (RMSE), Maximum Absolute Error (MAE), and Root Mean Squared Logarithmic Error (RMSLE). The GLM model has shown maximum accuracy in terms of (R2 = 0.999964, RMSE = 0.759963, MAE = 0.525975, and RMSLE = 0.005606) and is the best prediction model for estimating WQI as compared to DRF and XRT models. Further, the WQI results suggested that approximately 53% of the groundwater samples fall under the excellent to the good category for drinking. For a better assessment of these 13 water quality parameters, the spatial distribution map has also been plotted by using Arc-GIS. The expected results will contribute to the effective management of groundwater worldwide.