Encapsulating metal-based catalysts inside carbon sheaths is a frequently-adopted strategy to enhance their durability under various harsh situations and improve their catalytic activity simultaneously. Such carbon encapsulation, however, imposes significant complications for directly modifying materials’ surface atomic/electronic configurations, fundamentally impeding the accurate tuning of their catalytic capabilities. Herein, a universal single-atom alloy (SAA) strategy is reported to indirectly yet precisely manipulate the surface electronic structure of carbon-encapsulated electrocatalysts. By versatilely constructing a SAA core inside an N-doped carbon sheath, material's electrocatalytic capability can be flexibly tuned. The one with Ru-SAA cores serves as an excellent bifunctional electrocatalyst for oxygen/hydrogen evolution, exhibiting minimal cell voltage of 1.55 V (10 mA cm−2) and outstanding mass activity of 1251 mA m (Formula presented.) for overall water splitting, while the one with Ir-SAA cores possesses superior oxygen reduction activity with a half-wave potential of 919 mV. Density functional theory calculations reveal that the doped atoms can simultaneously optimize the adsorption of protons (H*) and oxygenated intermediates (OH*, O*, and OOH*) to achieve the remarkable thermoneutral hydrogen evolution and enhanced oxygen evolution. This work thus demonstrates a versatile strategy to precisely modify the surface electronic properties of carbon-shielded materials for optimized performances.