Acanthamoeba keratitis is difficult to treat because Acanthamoeba cysts are resistant to the majority of antimicrobial agents. Despite the efficacy of 0.02% chlorhexidine in treating Acanthamoeba keratitis, a lack of data in the literature regarding the formulation's stability limits its clinical use. The objective of this study was to develop an optimal extemporaneous 0.02% chlorhexidine digluconate ophthalmic formulation for patients in need. Methods: With available active pharmaceutical ingredients, 0.02% chlorhexidine digluconate sample solutions were prepared by diluting with BSS Plus Solution or acetate buffer. Influences of the buffer, type of container, and temperature under daily-open condition were assessed based on the changes of pH values and chlorhexidine concentrations of the test samples weekly. To determine the beyond-use date, the optimal samples were stored at 2–8°C or room temperature, and analyzed at time 0 and at Week 1, Week 2, Week 3, Week 4, Week 5, Week 8, Week 12, and Week 24. Results: Despite chlorhexidine exhibiting better stability in acetate buffer than in BSS solution, its shelf-life was