In Hoffmann's carbylamine test (also known as Isocyanide test), aliphatic or aromatic primary amine (A) is heated with chloroform (compound Y) in presence of alcoholic potassium hydroxide to give foul smelling alkyl/aryl isocyanide or carbylamine.
Compound Y (chloroform) is obtained by reaction of compound Z (CH3CH2OH) with chlorine in presence of slaked lime.
C6H5−NH2A+CHCl3+3KOHheat−−→C6H5−NC+3KCl+3H2O
CH3CH2OHZ+3Cl2→CCl3CHO+3HCl
2CCl3CHO+Ca(OH)2→2CHCl3Y+(HCOO)2Ca