well there are two different ways of working out the energy. but they give you different things.
One is E^2= (Pc)^2+(m^2)c^4
P = momentum
This is a more complex form of E=mc^2 becuase it takes into account the particles motion. Where as E=mc^2 the particle must be at rest.
This gives us the total energy of the particle.
However when you collide two partices not all there energy goes into the collision(ie they might have a glancing blow or left over momentum) so we use another formular to work out this energy. However its a lot more complex.