The purpose of this paper is to optimize the ratio of wall materials (chitosan (CH): maltodextrin (MD), X 1) and spent coffee ground extract (SCGE) to the complex wall material (X 2), i.e. the so-called infeed formula for the SCGE encapsulation by freeze drying. The response surface methodology (RSM), based on the central composite design (CCD), was applied to obtain the infeed formula, providing the best encapsulated SCGE properties (encapsulation yield (EY), hygroscopicity (HG), water solubility index (WSI), total phenolic compounds (TPC) and encapsulation efficiency (EE)). Multiple regression analysis was performed to derive a second-order polynomial equation for predicting properties. The EY (R 2 = 0.80), HG (R 2 = 0.95), WSI (R 2 = 0.96) and TPC (R 2 = 0.97) fitted the data well, and was ultimately used to plot a response surface. The plots obtained indicate that the EY and WSI significantly increased during the experimental process, whereas the HG and TPC decreased with the decreasing X 1 and X 2 (p≤ 0.05). The equations were used to optimize the infeed formula. The results obtained show that the infeed formula with the CH-to-MD of 30:70 and the SCGE-to-the-wall material of 90:10 would provide the most favorable outcomes (EY (80 %), HG (17g/100 g SCGE db), WSI (88 %) and TPC (5.27 g gallic acid equivalent/100 g SCGE db)).