The isothermal compressibility of water is essential to understand its anomalous properties. We compute it by ab initio molecular dynamics simulations of 200 molecules at five densities, using two different van der Waals density functionals. While both functionals predict compressibilities within ~30% of experiment, only one of them accurately reproduces, within the uncertainty of the simulation, the density dependence of the self-diffusion coefficient in the anomalous region. The discrepancies between the two functionals are explained in terms of the low- and high-density structures of the liquid.