Methyl ketones [1] react with halogens in basic media generating carboxylates [2] and haloform [ 3] .

The mechanism consists in completely halogenating the methyl, substituting in a later stage the -CX 3 formed by -OH.

3 - group is very basic and deprotonates the carboxylic acid, forming iodoform and the carboxylate.

This reaction (with iodine) can be used as an analytical test to identify methyl ketones, taking advantage of the fact that iodoform precipitates yellow.