The breakthrough in water electrolysis technology for the sustainable production of H2, considered as a future fuel, is currently hampered by the development of tough electrocatalytic materials. We report a new strategy of fabricating conducting polymer-derived nanostructured materials to accelerate the electrocatalytic hydrogen evolution reaction (HER), oxygen evolution reaction (OER), and water splitting. Extended physical (XRD, scanning electron microscopy (SEM), energy-dispersive X-ray spectroscopy (EDX)) and electrochemical (cyclic voltammetry (CV), linear sweep voltammetry (LSV), electrochemical impedance spectroscopy (EIS)) methods were merged to precisely characterize the as-synthesized iridium and ruthenium modified polyaniline (PANI) materials and interrogate their efficiency. The presence of Ir(+III) cations during polymerization leads to the formation of Ir metal nanoparticles, while Ru(+III) induces the formation of RuO2 oxide nanoparticles by thermal treatment; they are therefore methods for the on-demand production of oxide or metal nanostructured electrocatalysts. The findings from using 0.5 M H2SO4 highlight an ultrafast electrochemical kinetic of the material PANI-Ir for HER (36 − 0 = 36 mV overpotential to reach 10 mA cm−2 at 21 mV dec−1), and of PANI-Ru for OER (1.47 − 1.23 = 240 mV overpotential to reach 10 mA cm−2 at 47 mV dec−1), resulting in an efficient water splitting exactly at its thermoneutral cell voltage of 1.45 V, and satisfactory durability (96 h).