The invention relates to a method for producing L-carnitine on the basis of a betaine ester of the general formula (I), wherein R<1> and R<2> represent either hydrogen or together form a bond, and R<3> represents alkyl, aryl or arylalkyl, by means of hydrolases that convert said betaine ester to give the betaine. The betaine so obtained is then converted to L-carnitine by means of a microorganism capable of converting the betaine of formula (II) to L-carnitine. The invention further relates to hydrolases that convert 4-butyrobetaine methyl ester to 4-butyrobetaine and to microorganisms that contain such hydrolases.