Dilute acid pretreatment of lignocellulosic material is one of the significant steps in a biorefinery. We used response surface methodology to determine the important factors of formic acid concentration (2%–6% wt%), treatment time (30–150 min), reaction temperature (120–160 °C), and liquid to solid ratio (3–11 mL/g) on dilute acid hydrolysis of corn cob to produce xylose. A xylose yield of 81.6% and selectivity of 15.1 g/g were achieved under the optimal conditions (5% acid concentration, 150 min, 135 °C, and 7 mL/g liquid to solid ratio). The addition of trivalent salts (FeCl3, Fe(NO3)3, and Fe2(SO4)3) to the reaction system enhanced the xylose yield but decreased selectivity. The FeCl3 concentration over 0.75 mol/L had a negative effect on xylose production.