The charge redistribution at grain boundaries determines the applicability of high-Tc superconductors in electronic devices, because the transport across the grains can be hindered considerably. We investigate the local charge transfer and the modification of the electronic states in the vicinity of the grain-grain interface by first principles calculations for a (normal-state) 45 • -tilted [001] grain boundary in YBa2Cu3O7. Our results explain the suppressed interface transport and the influence of grain boundary doping in a quantitative manner, in accordance with the experimental situation. The charge redistribution is found to be strongly inhomogeneous, which has a substantial effect on transport properties since it gives rise to a self-doping of 0.10 ± 0.02 holes per Cu atom.