A portable x-ray fluorescence spectrometer was assembled with an x-ray generator that was driven by a 9 V dry electric battery. Several possible optimum geometries of the x-ray generator and detector were evaluated, and the results showed that the intensity of fluorescent x-rays was strong enough when the angle between the x-ray generator and detector was as small as 30°. The geometrically optimized x-ray spectrometer was applied to the analysis of paints, plastics and aluminum foils. Pigments in paint and toxic elements in plastic could be easily detected with on-site analysis. Fe in aluminum foil was quantitatively determined down to the sub-% level. The detection limit of Fe was 180 ppm for 100 s of measurement. Copyright © 2005 John Wiley & Sons, Ltd.