The H.E.S.S. experiment has collected data for more than 10 years. Despite its design for gamma-ray astronomy, H.E.S.S. already demonstrated in the past its ability to measure the cosmic-ray electron spectrum above a few hundred GeV up to ~4 TeV. Since this first measurement, new observations have increased the amount of available data for such an analysis by more than a factor of four. Furthermore, with a new analysis method we are now able to reduce the systematic uncertainty due to the different hadronic interaction models. Along with improvements in reconstruction algorithms, the reduction of systematic uncertainties and the increase in statistics allow a more precise measurement of the low energy part of the spectrum and allow to extend the measurement up to ~20 TeV. After a general introduction, this seminar will focus on the latest measurement of the cosmic-ray electron spectrum with H.E.S.S. and its consequences.