An accurate estimation of the state of charge (SOC) is necessary not only for optimal energy management but also for protecting the lithium-ion batteries (LIB) from being deeply discharged or overcharged. In this paper, an equivalent circuit model (ECM) is established to simulate the dynamic behavior of LIB. Parameters of internal resistance, diffusion resistance and diffusion capacitance are identified using the recursive least square method. Because open circuit voltage (OCV) and SOC have an obviously nonlinear relationship, an extended Kalman filter is proposed to estimate the SOC based on the ECM model. Local linearization is employed to approximate the nonlinear SOC-OCV curve by a straight line with the slope and intersection around the operating point. Simulation results show that the estimation error of the proposed algorithm is less than 5% for the test patterns.