This study aimed to formulate floating gastroretentive tablets containing metformin hydrochloric acid (HCl), using various grades of hydrogel such as tamarind powders and xanthan to overcome short gastric residence time of the conventional dosage forms. Different concentrations of the hydrogels were tested to determine the formulation that could provide a sustained release of 12 h. Eleven formulations with different ratios of tamarind seed powder/tamarind kernel powder (TKP):xanthan were prepared. The physical parameters were observed, and in vitro drug-release studies of the prepared formulations were carried out. Optimal formulation was assessed for physicochemical properties, thermal stability, and chemical interaction followed by in vivo gamma scintigraphy study. MKP3 formulation with a TKP:xanthan ratio of 3:2 was found to have 99.87% release over 12 h. Furthermore, in vivo gamma scintigraphy study was carried out for the optimized formulation in healthy New Zealand White rabbits, and the pharmacokinetic parameters of developed formulations were obtained. 153Sm2O3 was used to trace the profile of release in the gastrointestinal tract of the rabbits, and the drug release was analyzed. The time (Tmax) at which the maximum concentration of metformin HCl in the blood (Cmax) was observed, and it was extended four times for the gastroretentive formulation in comparison with the formulation without polymers. Cmax and the half-life were found to be within an acceptable range. It is therefore concluded that MKP3 is the optimal formulation for sustained release of metformin HCl over a period of 12 h as a result of its floating properties in the gastric region.