In this paper, a Fourier spectral method for numerically solving Cahn-Hilliard equation with periodic boundary conditions is developed. We establish their semi-discrete and fully discrete schemes that inherit the energy dissipation property and mass conservation property from the associated continuous problem. we prove existence and uniqueness of the numerical solution and derive the optimal error bounds. we perform some numerical experiments which confirm our results.