A reliable method for the determination of carbonyl compounds in exhaled breath based on on-sorbent derivatization coupled with thermal desorption and gas chromatography-tandem mass spectrometry is described. The analytical performances were optimized for a mixture of C2-C9 aldehydes and C3-C9 ketones, particularly interesting for clinical applications, by using an internal standard and applying a 23 full factorial design. A volume of sample (250 ml) was loaded at 50 ml min-1 into a Tenax GR sorbent tube containing 130 nmol of O-(2,3,4,5,6-pentafluorobenzyl)hydroxylamine hydrochloride. All compounds showed a limit of detection lower than 200 pptv. The yield of the derivatization procedure was normalized by adding to the sample a known amount of 6D-acetone as an internal standard. This allowed halving the relative standard deviation to 10% and 15% for the mono-and di-carbonyl compounds, respectively, thus improving reliability. The optimized method was applied to the determination of carbonyl compounds in 12 breath samples collected from four patients suffering from heart failure during hospitalization.