Constraints on the lifetime and width of the Higgs boson are obtained from H→ZZ→4ℓ events using data recorded by the CMS experiment during the LHC run 1 with an integrated luminosity of 5.1 and 19.7 fb−1 at a center-of-mass energy of 7 and 8 TeV, respectively. The measurement of the Higgs boson lifetime is derived from its flight distance in the CMS detector with an upper bound of τH<1.9×10−13 s at the 95% confidence level (C.L.), corresponding to a lower bound on the width of ΓH>3.5×10−9 MeV. The measurement of the width is obtained from an off-shell production technique, generalized to include anomalous couplings of the Higgs boson to two electroweak bosons. From this measurement, a joint constraint is set on the Higgs boson width and a parameter fΛQ that expresses an anomalous coupling contribution as an on-shell cross-section fraction. The limit on the Higgs boson width is ΓH<46 MeV with fΛQ unconstrained and ΓH<26 MeV for fΛQ=0 at the 95% C.L. The constraint fΛQ<3.8×10−3 at the 95% C.L. is obtained for the expected standard model Higgs boson width.