Thermal energy is the total kinetic and potential energy of the microscopic particles (atoms, ions, or molecules) in a substance or system, which results from their random motion and vibration, and is responsible for the temperature of the substance or system.