Thermal energy is the energy of an object due to random motions of its atoms and molecules. The hotter the object, the greater its thermal energy. Thermal energy is an extensive variable, proportional to the size of the object. The individual molecules can have different kinetic energies, but a hot object has a higher average value. In a gas or a liquid, molecules can move freely in all directions; in a solid, molecules execute small vibrations in all directions about fixed positions.
In this Demonstration, molecules are shown as red points and their direction of motion is represented by yellow lines. The length of the lines is proportional to the average thermal energy of the particles while the color of the cuboid reflects the temperature of the body.