2,4-Dinitrophenylhydrazine can be used to qualitatively detect the carbonyl functionality of a ketone or aldehyde functional group. A positive test is signaled by a yellow, orange or red precipitate (known as a dinitrophenylhydrazone.) If the carbonyl compound is aromatic, then the precipitate will be red; if aliphatic, then the precipitate will have a more yellow color. The reaction between 2,4-Dinitrophenylhydrazine and a ketone is shown below:
RR'C=O + C6H3(NO2)2NHNH2 → C6H3(NO2)2NHNCRR' + H2O
Dinitrophenylhydrazine does not react with other carbonyl-containing functional groups such as carboxylic acids, amides, and esters. For carboxylic acids, amides and esters, there is resonance associated stability as a lone-pair of electrons interacts with the p-orbital of the carbonyl carbon resulting in increased delocalization in the molecule. This stability would be lost by addition of a reagent to the carbonyl group. Hence, these compounds are more resistant to addition reactions. Also with carboxylic acids there is the effect of the compound acting as a base, leaving the resulting carboxylate negatively charged hence unable to be attacked by this nucleophile.