The band structure, densities of states, partial charges, electron densities, and electric-field gradients (EFG's) of YBa2Cu4O8 are determined from first-principles calculations using the full-potential linearized-augmented-plane-wave method. Exchange and correlation effects are treated by the local-density approximation. The doubling of the copper-oxygen chains with respect to YBa2Cu3O7 affects the electronic structure, especially near the chain oxygen, which has a third copper neighbor. The charge distribution around this position is drastically changed, and consequently the asymmetry parameter of the EFG is increased from 0.3 to 1.0, while the principal EFG component becomes similar for all-oxygen positions. The bonding characteristic of the double chains is illustrated by difference electron densities. The core-level shifts are estimated and agree with experimental data, which are available for Ba and Y.