The ATLAS detector at the Large Hadron Collider is used to search for excited electrons and excited muons in the channel pp → ℓℓ* → ℓℓγ, assuming that excited leptons are produced via contact interactions. The analysis is based on 13 fb-1 of pp collisions at a centre-of-mass energy of 8 TeV. No evidence for excited leptons is found, and a limit is set at the 95% credibility level on the cross section times branching ratio as a function of the excited-lepton mass mℓ*. For mℓ* ≥ 0.8 TeV, the respective upper limits on σB(ℓ* → ℓγ) are 0.75 and 0.90 fb for the e* and μ* searches. Limits on σB are converted into lower bounds on the compositeness scale Λ. In the special case where Λ = mℓ*, excited-electron and excited-muon masses below 2.2 TeV are excluded.