The ATLAS detector at the Large Hadron Collider is used to search for excited electrons and excited muons in the channel pp -> ll* -> ll gamma, 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(l*). For m(l*) >= 0.8 TeV, the respective upper limits on sigma B(l(*) -> l gamma) are 0.75 and 0.90 fb for the e* and mu* searches. Limits on sigma B are converted into lower bounds on the compositeness scale 3. In the special case where Lambda = m(l*), excited-electron and excited-muon masses below 2.2 TeV are excluded.