Research into liquids has a long history starting from the same time when the theory of gases was developed, forming the basis for our current understanding of the gas state of matter. Yet no theory of liquid heat capacity currently exists, contrary to gases or, for that matter, solids. The perceived difficulty is that interactions in a liquid are both strong and system-specific, implying that the energy strongly depends on the liquid type and that, therefore, liquid energy can not be calculated in general form. We develop a phonon theory of liquids where this problem is avoided. The theory covers both classical and quantum regimes. We demonstrate good agreement of calculated and experimental heat capacity of 21 liquids, including noble, metallic, molecular and hydrogen-bonded network liquids in a wide range of temperature and pressure.