It has been demonstrated in experiments that charge transport through self-assembled monolayers (SAMs) of alkanethiolates shows intriguing odd–even effects when the number of methylene groups changes. Most previously reported theoretical investigations were based on semiempirical methods or largely simplified models and the quantum origin of the observed odd–even effects is still unclear. In the current study, we performed ab initio calculations for electronic and transport properties of SAM of alkanethiolates on Ag  surface. Extensive density functional theory (DFT) based energy minimizations of the system geometries were conducted to pinpoint the most accurate geometries amenable to experimental observations. The recently proposed dual mean field (DMF) approach that includes bias-induced nonequilibrium effects in density functionals is used to determine current–voltage characteristics. Odd–even effects are observed in both electric currents and binding energies between the SAM and the probing electrode. The significant difference between the tunneling barriers across the “top” contact of odd and even molecular junctions is revealed to be the origin of the odd–even effects in electron transport. Our calculations suggest that the odd–even effects in charge transport in the system under study occur for alkanethiolate molecules with a certain length (10 < n < 19, where n is the number of methylene groups).