The ferroelectricity of the spiral magnets LiCu2O2 and LiCuVO4 was examined by calculating the electric polarizations of their spin spiral states on the basis of density functional theory with spin-orbit coupling. Our work unambiguously reveals that spin-orbit coupling is responsible for the ferroelectricity with the primary contribution from the spin-orbit coupling on the Cu sites, but the asymmetric density distribution responsible for the electric polarization occurs mainly around the O atoms. The electric polarization is calculated to be much greater for the ab- than for the bc-plane spin spiral. The observed spin-spiral plane is found to be consistent with the observed direction of the electric polarization for LiCuVO4, but inconsistent for LiCu2O2.