We present a method to measure the von Neumann entanglement entropy of ground states of quantum many-body systems which does not require access to the system wave function. The technique is based on a direct thermodynamic study of lattice entanglement Hamiltonians—recently proposed in the paper [Dalmonte et al 2018 Nat. Phys. 14 827] via field theoretical insights—and can be performed by quantum Monte Carlo methods. We benchmark our technique on critical quantum spin chains, and apply it to several two-dimensional quantum magnets, where we are able to unambiguously determine the onset of area law in the entanglement entropy, the number of Goldstone bosons, and to check a recent conjecture on geometric entanglement contribution at critical points described by strongly coupled field theories. The protocol can also be adapted to measure entanglement in experiments via quantum quenches.