An in situ procedure for quantifying total organic and inorganic Cl concentrations in environmental samples based on X-ray absorption near-edge structure (XANES) spectroscopy has been developed. Cl 1s XANES spectra reflect contributions from all Cl species present in a sample, providing a definitive measure of total Cl concentration in chemically heterogeneous samples. Spectral features near the Cl K-absorption edge provide detailed information about the bonding state of Cl, whereas the absolute fluorescence intensity of the spectra is directly proportional to total Cl concentration, allowing for simultaneous determination of Cl speciation and concentration in plant, soil, and natural water samples. Absolute Cl concentrations are obtained from Cl 1s XANES spectra using a series of Cl standards in a matrix of uniform bulk density. With the high sensitivity of synchrotron-based X-ray absorption spectroscopy, Cl concentration can be reliably measured down to the 5-10 ppm range in solid and liquid samples. Referencing the characteristic near-edge features of Cl in various model compounds, we can distinguish between inorganic chloride (Cl(inorg)) and organochlorine (Cl(org)), as well as between aliphatic Cl(org) and aromatic Cl(org), with uncertainties in the range of approximately 6%. In addition, total organic and inorganic Br concentrations in sediment samples are quantified using a combination of Br 1s XANES and X-ray fluorescence (XRF) spectroscopy. Br concentration is detected down to approximately 1 ppm by XRF, and Br 1s XANES spectra allow quantification of the Br(inorg) and Br(org) fractions. These procedures provide nondestructive, element-specific techniques for quantification of Cl and Br concentrations that preclude extensive sample preparation.