Measurements of the ZZ production cross sections in proton–proton collisions at center-of-mass energies of 7 and 8 TeV are presented. Candidate events for the leptonic decay mode ZZ → 2l2ν, where l denotes an electron or a muon, are reconstructed and selected from data corresponding to an integrated luminosity of 5.1 (19.6)fb-1 at 7 (8)TeV collected with the CMS experiment. The measured cross sections, (Formula presented.), are in good agreement with the standard model predictions with next-to-leading-order accuracy. The selected data are analyzed to search for anomalous triple gauge couplings involving the ZZ final state. In the absence of any deviation from the standard model predictions, limits are set on the relevant parameters. These limits are then combined with the previously published CMS results for ZZ in 4l final states, yielding the most stringent constraints on the anomalous couplings.