Reliable and accurate state of charge (SOC) monitoring is the most crucial part in the design of an electric vehicle (EV) battery management system (BMS). The lithium ion battery (LIB) is a highly complex electrochemical system, which performance changes with age. Therefore, measuring the SOC of a battery is a very complex and tedious process. This paper presents an online data-driven battery model identification method, where the battery parameters are updated using the Lagrange multiplier method. A battery model with unknown battery parameters was formulated in such a way that the terminal voltage at an instant time step is a linear combination of the voltages and load current. A cost function was defined to determine the optimal values of the unknown parameters with different data points measured experimentally. The constraints were added in the modified cost function using Lagrange multiplier method and the optimal value of update vector was determined using the gradient approach. An adaptive open circuit voltage (OCV) and SOC estimator was designed for the LIB. The experimental results showed that the proposed estimator is quite accurate and robust. The proposed method effectively tracks the time-varying parameters of a battery with high accuracy. During the SOC estimation, the maximum noted error was 1.28%. The convergence speed of the proposed method was only 81 s with a deliberate 100% initial error. Owing to the high accuracy and robustness, the proposed method can be used in the design of a BMS for real time applications.