Most types of particles have a corresponding antiparticle.
This has the same rest mass, but at least one property which is opposite to that of the particle.
When a particle and its antiparticle meet each other they annihilate each other. Their mass is converted into energy in the form of photons.
This is an example of mass being converted into energy. It can also work the other way around with energy being converted into mass.
High energy photons can produce a particle and its antiparticle. This is called pair production.
For pair production to occur, the electromagnetic energy, must be at least equivalent to the mass of two electrons. The mass m of a single electron is equivalent to 0.51 million electron volts (MeV) of energy. To produce two electrons, therefore, the photon energy must be at least 1.02 MeV.