Albert Einstein's forumla for his theory of general relativity.
E is Energy
M is Mass
C2 is really C squared (C^2).
The equation was first published in a slightly different formulation by Albert Einstein in 1905 in one of his famous articles. He derived it as a consequence of the special theory of relativity which he had proposed the same year.
E = mc² where m stands for rest mass (invariant mass), applies to all objects or systems with mass but no net momentum. Thus, it applies most simply to particles which are not in motion. However, in a more general case, it also applies to particle systems (such as ordinary objects) in which particles are moving but in different directions so as to cancel momentums. In the later case, both the mass and energy of the object include contributions from heat and particle motion, but the equation continues to hold.
The equation is a special case of a more general equation in which both energy and net momentum are taken into account. This equation applies to a particle that is not moving as seen from a reference point, but this same particle can be moving from the standpoint of other frames of reference. In such cases, the equation must become more complicated as the energy changes, since momentum terms must be added so that the mass remains constant from any reference frame.
Alternative formulations of relativity, see below, allow the mass to vary with energy and ignore momentum, but this involves use of a second definition of mass, called relativistic masss because it causes mass to differ in different reference frames.
A key point to understand is that there may be two different meanings used here for the word "mass". In one sense, mass refers to the usual mass that someone would measure if sitting still next to the mass, for example. This is the concept of rest mass, which is often denoted m0. It is also called invariant mass. In relativity, this type of mass does not change with the observer, but it is computed using both energy and momentum, and (unless momentum happens to be zero) the equation E = mc2 is not in general correct for it, if the total energy is wanted. (In other words, if this equation is used with constant invariant mass or rest mass of the object, the E given by the equation will always be the rest energy of the object, and will change with the object's internal energy, such as heating, but will not change with the object's overall motion).