A search for compositeness of electrons and muons is presented using a data sample of proton-proton collisions at a center-of-mass energy of s = 8 s√=8 TeV collected with the CMS detector at the LHC and corresponding to an integrated luminosity of 19.7 fb −1 . Excited leptons ( ℓ * ) produced via contact interactions in conjunction with a standard model lepton are considered, and a search is made for their gauge decay modes. The decays considered are ℓ * → ℓγ and ℓ * → ℓ Z, which give final states of two leptons and a photon or, depending on the Z-boson decay mode, four leptons or two leptons and two jets. The number of events observed in data is consistent with the standard model prediction. Exclusion limits are set on the excited lepton mass, and the compositeness scale Λ. For the case M ℓ * = Λ the existence of excited electrons (muons) is excluded up to masses of 2.45 (2.47) TeV at 95% confidence level. Neutral current decays of excited leptons are considered for the first time, and limits are extended to include the possibility that the weight factors f and f ′, which determine the couplings between standard model leptons and excited leptons via gauge mediated interactions, have opposite sign.