The number Fn of n-vertex graphs lacking a 4-cycle is shown to satisfy n⩽log Fn⩽ 1.08192n for large n. This represents an improvement of the previously known upper and lower bounds and resolves a long-standing question posed by Erdös. The result is obtained by using an argument previously used by the authors to bound the numbers of lattices on n elements.