Constraints on the lifetime and width of the Higgs boson are obtained from H → ZZ → 4l 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.