The Total Electron Content (TEC) in the ionosphere undergoes dynamic variations, primarily driven by solar radiation and influenced by a range of factors including geomagnetic activity. In this study, we utilize a backpropagation (BP) neural network for TEC modeling and systematically investigate how different geomagnetic indices affect model accuracy across various latitudes in East China, using 12 years (2008–2019) of TEC data from four International GNSS Service (IGS) GIM grid points (CA, BF, JN, and HS). The model inputs include solar activity indices (F10.7, Lyman- $\alpha $ ), periodic variations in TEC (annual, semiannual, diurnal, semidiurnal), and geomagnetic indices (Dst, Kp, Ap, AE), integrated into a two-hidden-layer network (20×20 nodes). Incorporating geomagnetic inputs significantly improved TEC modeling accuracy at mid-latitudes and yielded only marginal improvements at low latitudes. Specifically, at mid-latitude grid points (CA, BF), including geomagnetic indices reduced the Root Mean Squared Error (RMSE) by ∼7% (from 1.70 to 1.58 TECU) under geomagnetically quiet conditions. Moreover, the model effectively captured ionospheric responses during geomagnetic storms, accurately reproducing both positive and negative phases of ionospheric storms, as demonstrated by two representative events (October 25, 2011 and March 17, 2015). In contrast, at low-latitude grid points (JN, HS), the improvements were less pronounced, with less than 2% RMSE reduction under geomagnetically quiet conditions and only minor improvements during these ionospheric storm events. The optimized 20×20 BP neural network architecture achieved a favorable balance between accuracy and computational efficiency, providing useful insights for region-specific TEC modeling and reference for TEC forecasting.