The W boson mass is measured using proton-proton collision data at root s = 13 TeV corresponding to an integrated luminosity of 1.7fb(-1) recorded during 2016 by the LHCb experiment. With a simultaneous fit of the muon q/p(T) distribution of a sample of W ->mu y decays and the phi* distribution of a sample of Z -> mu mu decays the W boson mass is determined to be m(W )= 80354 +/- 23(stat )+/- 10(exp) +/- 17(theory) +/- 9(PDF) MeV, where uncertainties correspond to contributions from statistical, experimental systematic, theoretical and parton distribution function sources. This is an average of results based on three recent global parton distribution function sets. The measurement agrees well with the prediction of the global electroweak fi...