A measurement of the top quark mass is reported in events containing a single top quark produced via the electroweak t channel. The analysis is performed using data from proton-proton collisions collected with the CMS detector at the LHC at a centre-of-mass energy of 8 TeV, corresponding to an integrated luminosity of 19.7 fb −1. Top quark candidates are reconstructed from their decay to a W boson and a b quark, with the W boson decaying leptonically to a muon and a neutrino. The final state signature and kinematic properties of single top quark events in the t channel are used to enhance the purity of the sample, suppressing the contribution from top quark pair production. A fit to the invariant mass distribution of reconstructed top quark candidates yields a value of the top quark mass of 172.95±0.77(stat) +0.97 −0.93 (syst)GeV. This result is in agreement with the current world average, and represents the first measurement of the top quark mass in event topologies not dominated by top quark pair production, therefore contributing to future averages with partially uncorrelated systematic uncertainties and a largely uncorrelated statistical uncertainty.