The on-fibre derivatisation of volatile fatty acids (VFAs) using N-(tert-butyldimethylsilyl)-N-methyltrifluoroacetamide (MTBSTFA) was optimised in the simultaneous determination of VFAs together with phenols and indoles by headspace solid-phase microextraction (SPME)-gas chromatography-mass spectrometry. Firstly, the nature of the SPME fibre was optimised and four different fibres were studied (100 microm polydimethylsiloxane, 85 microm Carboxen/polydimethylsiloxane, 5/30 microm divinylbenzene/Carboxen/polydimethylsiloxane and 85 microm polyacrylate). The optimum fibre (50/30 microm divinylbenzene/Carboxen/polydimethylsiloxane) was used to study the exposure time of the fibre to the derivatisation agent and the desorption time and temperature. Firstly, a factorial design was built but since the three variables had a significant effect, a central composite design was used to build the response surfaces. The best signals were obtained after the exposure of the fibre in the headspace of the MTBSTFA derivatisation reagent for 1 h and desorption at 300 degrees C for 9 min. The determination of underivatised phenols and indoles was not affected by the presence of the derivatisation reagent in the fibre.