Involved in the detoxification of xenobiotics and in the activation of ester and amide prodrugs (PubMed:9169443). Shows high catalytic efficiency for hydrolysis of cocaine, 4-methylumbelliferyl acetate, heroin and 6-monoacetylmorphine (PubMed:9169443). Hydrolyzes aspirin, substrates with large alcohol group and small acyl group and endogenous lipids such as triacylglycerol (PubMed:28677105). Converts monoacylglycerides to free fatty acids and glycerol. Hydrolyzes of 2- arachidonoylglycerol and prostaglandins (PubMed:21049984). {ECO:0000269|PubMed:21049984, ECO:0000269|PubMed:9169443, ECO:0000303|PubMed:28677105}. This is the function of Ensembl gene identifier ENSG00000172831 (CES2, carboxylesterase 2).