# Does $E = mc^2$ apply to photons?

Photons are massless, but if $m = 0$ and $E = mc^2$ then $E = 0c^2 = 0$. This would say that photons have no energy, which is not true.

However, given the formula $E = ℎf$, a photon does have energy as ℎ is a constant not zero and photons with a zero frequency do not exist.

What am I missing here, or does the famous formula not apply to photons?

-
The correct energy-momentum relation is $E^2 = p^2c^2 + m^2c^4$, where $p$ is the momentum.( See en.wikipedia.org/wiki/Photon#Physical_properties .) Only for particles at rest we have $E = mc^2$. –  Heidar Mar 2 '11 at 0:36
Indeed, $E = mc^2$ being paraded as the poster child of "beautiful physics" is sort of misleading and doesn't mean anything without the proper context. –  Justin L. Mar 2 '11 at 6:58

There are two explanations possible stemming from the fact that the definition of $m$ in the formula is ambiguous. Well, perhaps Einstein had only one of the two meanings in mind in his original paper but I'm afraid I wouldn't know that as I haven't read it. By that as it may one should recall that special relativity mixes space and time and therefore also momentum and energy and the full formula relating all these fundamental quantities has to be $$E^2 = m_0^2c^4 + p^2c^2$$ where $m_0$ is the rest mass of the particle (zero for photons) whose importance lies in the fact that it is invariant w.r.t. Lorentz transformations (rotations and boosts). So first explanation is that the famous formula only holds in the object's rest frame ($p=0$). But such a rest frame isn't available for photons so that formula indeed isn't valid for them.
The other explanation is through the concept of relativistic mass. In that case the $m$ takes on the meaning of apparent mass because the faster the object goes the harder it will be to accelerate it (because of finite speed of light). So formally one can still talk about the photon having a relativistic (or effective) mass $m = E/c^2$. But this concept of mass runs in all kinds of problems so its usage is discouraged.
You dont need quantum mechanics to argue here, you can simply look to the equation with the rest mass, instead the one with the relativistic mass. This is $$E^2= m_0^2 c^4 + p^2 c^2$$ So, any particle with zero rest mass still has Energy coming from the linear momentum.