A peptic ulcer is an alimentary tract injury that leads to a mucosal defect reaching the submucosa. This work aimed to optimize and maximize ellagic acid (EA) loading in Ca pectinate floating beads to maximize the release for 24 h. Three factors were selected: Ca pectinate concentration (X1, 1–3 w/v %), EA concentration (X2, 1–3 w/v %) and the dropping time (X3, 10–30 min). The factorial design proposed eight formulations. The optimized EA–Ca pectinate formulation was evaluated for the gastric ulcer index and the oxidative stress parameter determination of gastric mucosa. The results indicated that the optimum EA–Ca pectinate formula significantly improved the gastric ulcer index in comparison with raw EA. The protective effect of the optimized EA–Ca pectinate formula was further indicated by the histopathological features of the stomach. The results of the study indicate that an EA formulation in the form of Ca pectinate beads would be effective for protection against gastric ulcers because of Nonsteroidal anti-inflammatory drugs (NSAID) administration.