The formation of interface dipoles in self-assembled monolayers (SAMs) of -CH3 and -CF3 terminated short-chain alkanethiolates on Ag(111) is studied by means of density functional theory calculations. The interface dipoles are characterized by monitoring the change in the surface work function upon adsorption of the SAM. We compare results obtained for SAMs in structures with a different packing density of molecules, i.e. (• , and p(2×2). The work function of alkanethiolate SAMs on silver depends weakly on the packing density; that of fluorinated alkanethiolates shows a stronger dependance. The results are analyzed in terms of two nearly independent contributions to the interface dipole. These originate respectively from the molecular dipoles and from a charge transfer between the metal surface and the molecules. The charge transfer is determined by the silver-sulfur bond and it is independent of the electronegativity of the molecules.