Butterfly pea is a natural color source used in food and dessert. This study optimized ultrasound-assisted extraction with ethanol for pigments from butterfly pea flowers (BPF) using a Box-Behnken method. Key factors explored were solid-to-solvent ratio, ultrasound extraction time, and ethanol concentration. The extracted compounds were evaluated for extraction yield (EY), total phenolic content (TPC), total anthocyanin content (TAC), and DPPH antioxidant activity. EY increased significantly with reduced ethanol concentration. Optimal conditions were predicted and experimentally validated. BPF extracts showed distinct absorption wavelengths at different pH levels. BPF extract was used in coconut milk jelly, resulting in the lowest b* value. These findings highlight the value of optimal ultrasonic-assisted extraction for enhancing BPF's natural colorant extraction and promoting sustainable use in food and dessert applications.