We consider the numerical approximation of homogeneous Fredholm integral equations of second kind, with emphasis on computing truncated Karhunen–Loève expansions. We employ the spectral element method with Gauss–Lobatto–Legendre (GLL) collocation points. Similar to the piecewise-constant finite elements, this approach is simple to implement and does not lead to generalized discrete eigenvalue problems. Numerical experiments confirm the expected convergence rates for some classical kernels and illustrate how this approach can improve the finite element solution of partial differential equations with random input data.