We determined the atomic structures and energies of 109°, 180°, and 71° domain walls in BiFeO3, combining density functional theory+U calculations and aberration-corrected transmission electron microscopy images. We find a substantial Bi sublattice shift and a rather uniform Fe sublattice across the walls. The calculated wall energies (γ) follow the sequence γ109<γ180<γ71 for the 109°, 180°, and 71° walls. We attribute the high 71° wall energy to an opposite tilting rotation of the oxygen octahedra and the low 109° wall energy to the opposite twisting rotation of the oxygen octahedra across the domain walls.