haloform reaction
/ HAL-oh-form /
Take a methyl ketone — any compound with a CH3 group attached directly to a C=O — treat it with excess halogen (often I2) and base, and something dramatic happens. All three hydrogens of the methyl group get replaced by halogen, and then the whole CX3 group is cleaved off. You end up with a carboxylate ion plus a molecule of haloform, CHX3. With iodine the haloform is iodoform, CHI3, a bright yellow solid that precipitates out — the classic positive iodoform test.
The mechanism chains together everything from base-promoted alpha-halogenation. Base removes an alpha-proton, the enolate grabs a halogen, and because each new halogen makes the remaining protons MORE acidic, the next two go on faster than the first. Now you have a -CO-CX3 group. The three electron-withdrawing halogens make the CX3 carbanion stable enough to be a leaving group: hydroxide adds to the carbonyl carbon, the C-C bond breaks, and CX3(minus) departs, immediately grabbing a proton to become CHX3.
The iodoform version is famous as a diagnostic test, because the yellow precipitate is unmistakable. A positive iodoform test signals a methyl ketone (CH3-CO-R) OR a secondary alcohol that oxidizes to one, CH3-CH(OH)-R, since the I2/base can oxidize it first. Acetaldehyde (CH3CHO) and ethanol also test positive. As a bonus, the reaction is a real synthetic tool: it converts a methyl ketone into a carboxylic acid one carbon shorter.
Acetone, CH3-CO-CH3, with I2 and NaOH gives sodium acetate (CH3COO minus Na plus) plus a yellow precipitate of iodoform, CHI3. Ethanol gives a positive test too, because it is oxidized to acetaldehyde first.
The yellow iodoform precipitate flags a methyl ketone or a CH3-CH(OH)- alcohol.
The test detects the CH3-CO- (or CH3-CH(OH)-) substructure, not 'any ketone'. A ketone like 3-pentanone, CH3CH2-CO-CH2CH3, has no methyl on the carbonyl and tests negative.