This paper aims to enhance the prediction accuracy of hydrogen solubility in aqueous solution, which is crucial for safe and efficient underground hydrogen storage (UHS). The study developed a new hybrid machine learning (ML) algorithm, particle swarm optimization-mixed effects random forest (PSO-MERF), and compared with Extreme Gradient Boosting (XGBoost), K-Nearest Neighbors (KNN), Random Forest (RF), and Equation of State (EOS) models. PSO-MERF demonstrated superior performance, achieving a high correlation coefficient (R) of 0.9982, root means square error (RMSE) of 0.0015, and mean absolute error (MAE) of 0.00091, with less computational time (1.01 s). Among the EOS models used, Soave-Redlich-Kwong (SRK) outperformed other models. The results suggest that PSO-MERF hyperparameter optimization leads to more accurate hydrogen solubility predictions, encouraging its use in UHS design and operation for safe and sustainable hydrogen storage.