A specimen containing nanograms of sulfur, calcium, and 3d transition metal elements was measured by incident X-ray beams of various sizes restricted by a waveguide placed in a portable TXRF spectrometer. The signal to background ratios of spectra decreased with an increase in incident X-ray beam size. The portable spectrometer was also applied to rainwater and a specimen containing antimony and rare earth elements. Nanograms of elements in these specimens were detected by K-line or L-line excitation.