The objective of this work was to assess the new polymer obtained from natural source (Helianthus annuus) in the formation of floating in situ gel of Ranitidine HCl. Low Methoxy Pectin (LMP), calcium carbonate, sodium citrate, D-mannitol, methylparaben and propylparaben were utilized in developing floating in situ gelling formulations. The developed formulations were evaluated for various physicochemical properties like viscosity, floating lag time, and duration of floating, in vitro gelation and in vitro drug release. The 32 full factorial design was applied wherein concentration of LMP and calcium carbonate were considered as independent variables whereas floating lag time and drug release after 8 h (Q8 ) were taken as dependent variables. All formulations (F1–F9) exhibited floating within 60 s and remained floated for around 24 h. All the formulations were pourable before coming in contact with gastric fluid. It was seen that floating lag time and cumulative percentage drug release was influenced by concentration of LMP and calcium carbonate. Formulation F5 showed optimum floating lag time (37 s) and drug release after 8 h (98.09%) amongst developed in situ gels. Thus it can be concluded that Ranitidine HCl can be formulated as floating in situ gel using LMP as a gelling polymer to sustain the drug release for 8 h.