The production of electrons from heavy-flavour hadron decays was measured as a function of transverse momentum (pTden">de">) in minimum-bias p–Pb collisions at den">de"> using the ALICE detector at the LHC. The measurement covers the pTden">de"> interval 0.5<pT<12 GeV/cden">de"> and the rapidity range de5b" title="Click to view the MathML source">−1.065<ycms<0.135den">de"> in the centre-of-mass reference frame. The contribution of electrons from background sources was subtracted using an invariant mass approach. The nuclear modification factor RpPbden">de"> was calculated by comparing the pTden">de">-differential invariant cross section in p–Pb collisions to a pp reference at the same centre-of-mass energy, which was obtained by interpolating measurements at dedf62c11">den">de"> and den">de">. The RpPbden">de"> is consistent with unity within uncertainties of about 25%, which become larger for pTden">de"> below 1 GeV/cden">de">. The measurement shows that heavy-flavour production is consistent with binary scaling, so that a suppression in the high-pTden">de"> yield in Pb–Pb collisions has to be attributed to effects induced by the hot medium produced in the final state. The data in p–Pb collisions are described by recent model calculations that include cold nuclear matter effects.