This paper aims at accurately modeling the nonlinear hysteretic relationship between open circuit voltage (OCV) and state of charge (SOC) for LiFePO4 batteries. The OCV-SOC hysteresis model is based on the discrete Preisach approach which divides the Preisach triangle into finite squares. To determine the weight of each square, a linear function system is constructed including a series of linear equations formulated at every sample time. This function system can be solved by computer offline. When applying this approach online, the calculated square weight vector is pre-stored in advance. Then through multiple operations with hysteresis state vector of squares updated online at every sampling time, the SOC considering the influence of OCV-SOC hysteresis is predicted. To solve the problem that SOC errors become large for non-training hysteresis input, a novel method based on an online adaptive discrete Preisach model (ADPM) is proposed, which reckons the prior offline weights as initial model parameters and introduces the difference between current derived from the model and the measured current as a feedback to adjust the square weight vector at every sampling time when batteries are in actual applications. Through choosing a proper fixed step factor, the maximum modeling error can be less than 1%. The results prove the efficiency and accuracy of the proposed model which contributes to battery management.