Volatilization of ammonia (NH3) from slurry applied in the field is considered a risk to the environment and reduces the fertilizer value of the slurry. To reduce volatilization a better understanding of the slurry–soil interaction is needed. Therefore, the present study focuses on measuring NH3 volatilization as affected by differences in infiltration. Livestock slurries with different dry matter (DM) composition and viscosity were included in the experiments by using untreated cattle and pig slurry, pig slurry anaerobically digested in a biogas plant and pig slurry anaerobically digested and physically separated. NH3 volatilization was measured using dynamic chambers and related to infiltration of the livestock slurries in the soil by measuring chloride (Cl−) and Total Ammoniacal Nitrogen (TAN=ammonium (NH4+)+NH3) concentrations in soil at different depths from 0·5 to 6·0 cm from the soil surface. The slurries were applied to sandy and sandy-loam soils packed in boxes within the chambers. There were no significant differences in relative volatilization of NH3 from untreated cattle and pig slurries, but anaerobic digestion of pig slurry increased volatilization due to increases in pH. However, physical separation of the digested slurry reduced the volatilization compared with untreated slurry, due to increased infiltration. In general, the volatilization decreased significantly with increased infiltration. The present study shows that NH3 volatilization from applied slurry can be related to infiltration and that infiltration is related to slurry composition (i.e. DM content and particle size distribution) and soil water content. The infiltration of liquid (measured by Cl− infiltration) was affected by soil water potential, therefore, Cl− infiltrated deeper into the sandy loam soil than the sandy soil at similar gravimetric soil water values. Dry matter (DM) and large particles (>1 mm) of the slurry reduced infiltration of liquid. A high proportion of small particles (<0·025 mm) facilitated infiltration of TAN.