An integrated starter and generator (ISG) is a type of electric machine which is mechanically connected to an internal combustion engine (ICE). The ISG is intended to conduct important roles in the hybrid electric vehicle (HEV) such as engine start and stop. Since the HEV has frequent electric vehicle (EV)/HEV mode transition, rapid engine cranking and vibration-free engine stop controls are necessary. In the case of the engine stop, the ISG provides the negative torque output to the ICE which can rapidly escape from its resonance speed. However, the ISG torque is determined by engineering intuition, the amount of energy recovery is hardly considered. Dynamic programming (DP) is an effective solution to find optimal ISG control strategy to maximize energy recovery during engine stop transition. Even though DP is an offline algorithm, the result can be used as a reference to evaluate and improve an existing on-line algorithm. In this paper, the procedures for applying DP to ISG control during engine stop transition are explained. Simplified powertrain model, which consists of mechanical and electrical parts of HEV powertrain, is given. Then DP is applied to this model in order to verify the effect of cost function on maximizing energy recovery. In the simulation, the amount of energy recovery using DP is about 70kJ for 40 engine stop events over FTP 4-bag cycle. In addition, based on the DP result, a look-up table based real-time control is developed in the small size HEV. This experiment results in an improvement of 0.7 % better mileage in FTP 4-bag cycle.