An in-line near infrared (NIR) spectrometer was employed to monitor phase transformations of erythromycin dihydrate during a miniaturized fluid bed drying process. The pellets, containing 50% (w/w) erythromycin dihydrate and 50% (w/w) microcrystalline cellulose, were dried at 30, 45, and 60 degrees C. Principal component analysis was used to determine solid-state changes. For this purpose the wavelength range of 1360-2000 nm was selected and preprocessed to remove multiplicative effects. Transformation to erythromycin dehydrate was observed for the pellets dried at 45 and 60 degrees C by NIR spectrometry and X-ray powder diffractometry (XRPD). The formation of erythromycin dehydrate was observed at a moisture content 1.4% (w/w) (mass of water per dray mass of sample) while at 1.8% (w/w) neither XRPD nor NIR were able to detect dehydration. Transformation to erythromycin dehydrate therefore depends strongly on the moisture content of the pellets. (C) 2008 Wiley-Liss, Inc. and the American Pharmacists Association.