Ring-opening polymerization of five lactones catalyzed by Candida antarctica lipase B in ionic liquids yielded poly(hydroxyalkanoates) of moderate molecular weights up to Mn=13,000. In the ionic liquid 1-butyl-3-methylimidazolium bis(trifluoromethane)-sulfonimide and with a low weight ratio of enzyme to lactone (1:100) we obtained polymers from beta-propiolactone, delta-valerolactone, and epsilon-caprolactone with degrees of polymerization as high as 170, 25, and 85, respectively; oligomers from beta-butyrolactone and gamma-butyrolactone with degrees of polymerization of 5; and a copolymer of beta-propiolactone and beta-butyrolactone with a degree of polymerization of 180. Water-immiscible ionic liquids were superior to water-miscible ionic liquids. Reducing the water content of the enzyme improved the degree of polymerization by as much as 50% for beta-propiolactone and epsilon-caprolactone.