We study solvable spin chains, one-dimensional massless Dirac fermions and conformal field theories (CFTs) with sine-square deformation (SSD), in which the Hamiltonian density is modulated by the function f(x) = sin 2(πx/ℓ), where x is the position and ℓ is the length of the system. For the XY chain and the transverse field Ising chain at criticality, it is shown that the ground state of an open system with SSD is identical to that of a uniform chain with periodic boundary conditions. The same holds for the massless Dirac fermions with SSD, corresponding to the continuum limit of the gapless XY chain. For general CFTs, we find that the Hamiltonian of a system with SSD has an expression in terms of the generators of the Virasoro algebra. This allows us to show that the vacuum state is an exact eigenstate of the sine-square deformed Hamiltonian. Furthermore, for a restricted class of CFTs associated with affine Lie (Kac–Moody) algebras, including c = 1 Gaussian CFT, we prove that the vacuum is an exact ground state of the deformed Hamiltonian. This explains why the SSD has succeeded in suppressing boundary effects in one-dimensional critical systems, as observed in previous numerical studies.