Heteroatom modification represents one of the major areas of carbon materials' research in electrical energy storage. However, the influence of heteroatomic state evolution on electrochemical properties remains an elusive topic. Herein, thiophene-2,5-dicarboxylic acid is chemically activated to prepare O,S-diatomic hybrid carbon material (OS-C). The heteroatoms and carbon matrix coexist in the form of CO/CO and CS/SS bonds, which introduce porous networks to the partially graphitized carbon skeleton and provide abundant active sites for better ion absorption. Moreover, the heteroatoms and carbon matrix are bridged to establish stable pseudocapacitive functional groups like quinoid unit and disulfide bonds, which can be electrochemically converted into benzenoid units and mercaptan anions through Faradaic reactions to further improve the reversible capacity. Combined with the detailed kinetic exploration and in situ investigation of the electrochemical impedance spectra, the energy storage mechanism for lithium/sodium is proposed in the following steps: Faradaic reactions at a higher potential range, energy storage at active sites, and ions intercalation on the graphitized parts in the low-voltage states. Greatly, the electrode can store lithium up to the capacity of ≈700 mAh g −1 , while also delivering ≈330 mAh g −1 of sodium storage, providing lifetimes in excess of thousands of cycles.