A measurement of the W-boson mass is presented based on 4.6 fb^-1 of proton–proton collision data recorded in 2011 at a centre-of-mass energy of 7 TeV with the ATLAS detector at the LHC. The selected data sample consists of 7.8x10^6 candidates in the W -> mu nu channel and 5.9x10^6 candidates in the W -> e nu channel. The W-boson mass is determined using template fits to the charged lepton transverse momentum distributions, and to the charged lepton and E_T^miss transverse mass distribution. Special emphasis is placed on the evaluation of the experimental systematic uncertainties, as well as on the uncertainties due to the modeling of the vector boson production and decay. The final result is compared to the current world average and interpreted in the context of the global electroweak fit.