The energy needed for a change of state is found from the mass and the specific latent heat. The equation is: thermal energy for a change in state (J) = mass (kg) × specific latent heat (J/kg).
Use the specific latent heat of fusion for melting or freezing, and the specific latent heat of vaporisation for boiling or condensing. The value for vaporisation is much larger, so boiling a mass of water needs far more energy than melting the same mass of ice. The mass must be in kilograms.
For example, ice has a specific latent heat of fusion of 330 000 J/kg. Melting 0.5 kg of ice at 0 °C needs 0.5 × 330 000 = 165 000 J. Freezing 0.5 kg of water at 0 °C releases the same 165 000 J. Water has a specific latent heat of vaporisation of 2 260 000 J/kg, so boiling 0.1 kg of water at 100 °C needs 0.1 × 2 260 000 = 226 000 J. During a change of state the temperature stays constant.