We study at a quantitative level the impact of the uncertainties on the value of the W boson mass measured at hadron colliders due to: i) the proton parton distribution functions (PDFs), ii) the value of the strong coupling constant αs and iii) the value of the charm mass used in the PDF determination. The value of the W boson mass is extracted, by means of a template fit technique, from the lepton-pair transverse mass distribution measured in the charged current Drell-Yan process. We study the determination of mW at the Tevatron and at the LHC with 7 and 14 TeV of center-of-mass energy in a realistic experimental setup. The analysis has been done at the Born level using the event generator HORACE and at NLO-QCD using the event generators DYNNLO and RESBOS. We consider the three global PDF sets, CTEQ6.6, MSTW2008, and NNPDF2.1. We estimate that the total PDF uncertainty on mW is below 10 MeV both at the Tevatron and at the LHC for all energies and final states. We conclude that PDF uncertainties do not challenge a measurement of the W boson mass at the level of 10 MeV accuracy.