One of the biggest obstacles to accurately estimating the state of charge ( \(\text{SoC}\) ) of lithium-ion batteries is the issue of disturbances, unknown inputs, and model uncertainties. In order to solve these issues, this work proposes a resilient unknown input observer with L2-gain for estimating the \(\text{SoC}\) in batteries. In the common past studies, the uncertainties have been considered as an additive term to the dynamic equations of the battery, and then, a robust observer was designed to address this issue. In the presented work, instead of this method for modeling uncertainties, a region of matrices with different values is considered instead of a single matrix to describe the dynamics of the battery. Consequently, to reject the effect of these uncertainties, an L2-gain condition is considered to be satisfied, and in this way, the effect of the uncertainties on the estimation accuracy will be removed. To be more specific, L2-gain criterion tries to minimize the energy of the uncertainty over the energy of the estimation error. Finally, the problem is in the form of a linear matrix inequality, and by solving it, the observer’s gains are extracted. The impact of disruptions on the calculation of battery charge level is therefore reduced. Lastly, a number of real-world tests have been conducted to examine the productivity of the recommended tactic, and the outcomes validate the estimator’s efficacy and precision.