Einstein’s famous mass-energy equivalence equation, or E = mc2, is actually a special case of a slightly longer formula known as the energy-momentum relation, which is written out as E2 = p2c2 + m2c4.
This equation relates energy (E) to rest mass (m), the speed of light (c), and momentum (p), which is the key to how photons can carry energy but have no mass. When a particle is at rest, it has no momentum and the equation simplifies to the more familiar E = mc2. But if a particle has no mass, the equation becomes E = pc.
But wait, you might be asking, how can a particle have momentum without mass? That’s where light’s duality as both a wave and a particle comes into play. Unlike a particle, whose momentum is related to its mass, a wave’s momentum comes solely from its motion, meaning that it can carry momentum even without mass.
Interestingly, something that has neither mass or momentum has no energy, which means it is nothing at all — i.e., it cannot exist. But photons do exist, so it follows that they can never be at rest. And the only speed that remains the same in every reference frame is the universal speed limit (c). Light isn’t the only massless particle, however. Gluons, massless particles inside atoms, also travel at the speed of light.