Our aim is to optimize the formula of gastroretentive floating tablets of berberine hydrochloride and to evaluate its buoyant and drug release characteristics in vitro. In accordance to the nature of adjuvant and the quality of preparation and by using the single factor experiments to determine the main parameters which impact the properties of the gastroretentive floating tablets of berberine hydrochloride, the optimum prescription and experimental conditions were determined. Tablets were prepared by direct compression with dry powder. The floating properties in the artificial gastric juice was studied and the UV-visible spectrophotometry was used to detect the release volume of the gastroretentive floating tablets of berberine hydrochloride. Results show that the optimum prescription includs HPMC(K15M) 35mg, NaHCO320mg, CMS-Na 47mg and PEG600015mg. The tablet begins to float in 1min, and the floating time is over 12h.The total drug release in vitro in 12h is more than 80percent. The prepared tablets have good behavior of floating and release characteristics, and the preparation is simple.