The heartwood of Caesalpinia sappan L. contains brazilin, which exhibits excellent antibacterial activity. Its extract shows potential for incorporation into topical antibacterial products. This study aimed to optimize the conditions of an eco-friendly microwave-assisted extraction method to maximize brazilin content and antibacterial activity. It also optimized the film-forming antibacterial spray containing C. sappan heartwood extract using a Box–Behnken design. Ethanol concentration, microwave power, and microwave time were varied for microwave-assisted extraction. The optimized conditions of 28 % ethanol, 800 W microwave power, and 70-s microwave time maximized the extraction yield, brazilin content, and clear zones against Staphylococcus aureus and Staphylococcus epidermidis. The optimized extract was then incorporated into a film-forming spray. The film-forming spray formula's hydroxypropyl methylcellulose, glycerin, and ethanol contents were varied. Based on the design space, the optimized formulation comprised 0.6 % hydroxypropyl methylcellulose, 1.25 % glycerin, and 28 % ethanol. Approximately 97 % of the brazilin was released from the formulation during an 8-h release experiment. Moreover, approximately 25 % of the brazilin accumulated in the synthetic human skin-like membrane during an 8-h permeation experiment. In summary, this study successfully prepared, characterized, optimized, and verified a film-forming spray containing the optimized C. sappan heartwood extract obtained through microwave-assisted extraction.