Objective: The present study was aimed to develop a pH-triggered in situ gel for local release of lidocaine hydrochloride (lidocaine HCL) in the buccal cavity to improve the anesthetic effect of this amino amide drug which has very high water solubility. The formulations were introduced to the oral cavity as a spray to improve compliance and for easier administration.Methods: In this work, two grades of carbopol (934 and 940)-based in situ gel spray were designed. The formulations containing lidocaine HCl 5% were prepared by mixing different concentrations of carbopol with xanthan gum. Eight formulations were investigated and evaluated for gelation capacity, spray angle, volume of solution delivered per each actuation, rheological properties, and release kinetic model. Similarity factor (f2) was used for the comparison of dissolution profiles.Results: The prepared formulations undergo gelation after it had been actuated to the buccal cavity as a spray solution. The results showed that, as the concentration of polymer was increased, the release of drug decreased and the viscosity increased for both grades. The spray angle and volume of solution delivered per each actuation varied according to the composition of each formulation. The in situ gel containing 0.3% carbopol 934 and 0.2% xanthan gum regarded as a better candidate which had a good gelation and release property compared to other formulations. Drug release from optimized in situ gel spray followed Korsmeyer–Peppas model and was mediated by Fickian diffusion mechanism.Conclusion: Lidocaine HCl-loaded pH-sensitive in situ gel was successfully developed using carbopol 934 as polymer to be applied to the buccal cavity as spray solution for more effective anesthetic effect and painless treatment.