Ionic transport inside porous carbon electrodes underpins the storage of energy in supercapacitors and the rate at which they can charge and discharge, yet few studies have elucidated the materials properties that influence ion dynamics. Here we use in situ pulsed field gradient NMR spectroscopy to measure ionic diffusion in supercapacitors directly. We find that confinement in the nanoporous electrode structures decreases the effective self-diffusion coefficients of ions by over two orders of magnitude compared with neat electrolyte, and in-pore diffusion is modulated by changes in ion populations at the electrode/electrolyte interface during charging. Electrolyte concentration and carbon pore size distributions also affect in-pore diffusion and the movement of ions in and out of the nanopores. In light of our findings we propose that controlling the charging mechanism may allow the tuning of the energy and power performances of supercapacitors for a range of different applications.