Is mass another form of energy, or does all energy have mass?

Question can be expressed as:
Does a compressed spring have more mass than an uncompressed spring?

If something has more energy, does it automatically have more mass? Is the situation:
Energy (mass):
kinetic
potential

or
Energy:
mass
kinetic
potential

I’m thinking it’s the second one, because photons have 0 rest mass, but energy.

A compressed spring does have (slightly) more mass than a resting one, but it’s also true that a single photon has energy without having mass. Mass is best thought of as not a form of energy, but rather as, hm, a way of arranging it, maybe.

To explain further: The energy a system has depends on what frame of reference you’re looking at that system in. If I’m sitting on a train and see a ball sitting on the floor next to me, in my reference frame, that ball is not moving and thus has no kinetic energy. From the reference frame of someone standing beside the tracks, though, the ball is moving, and does have kinetic energy (in addition to whatever other forms of energy it might have, but we’ll agree on all of those). So the total amount of energy varies with reference frame: It might be larger or smaller, depending on who’s measuring it.

But for any given system, there is some amount of total energy that, no matter what reference frame you go to, you can’t ever measure less than that amount of energy. For instance, when I’m in the reference frame where that ball has zero momentum, I measure a certain amount of energy, and nobody in any other reference frame will ever measure less energy for it. This minimum amount of energy is what we refer to as the mass of the system.

For a photon, by contrast, we can always make a photon more redshifted (and hence lower energy) by moving in the same direction as it, at greater and greater speeds. The photon’s energy will always be nonzero, but it can be any number arbitrarily close to zero: There’s no absolute floor anywhere before zero. So we can say that the mass of a photon is zero.

Note here that mass is a property of a system as a whole, and the mass of the system might not be equal to the sum of the masses of its components. For instance, suppose that I have a system consisting of two photons, moving directly away from each other. I can chase after one photon to redshift it, but when I do that, I’m also blueshifting the other photon. No matter what reference frame I choose, I can never get the total energy lower than it is in the reference frame where both have the same energy. So even though each photon individually has zero mass, the system consisting of both photons does have mass.

This also means that, so long as you’re consistent in what you’re defining as your system, mass is totally conserved. For instance, if we start with a system consisting of an electron and a positron sitting at rest right next to each other, that system will have a total mass equal to twice the electron mass. Then, they annihilate and turn into a pair of photons moving apart, and the system of the pair of photons has exactly the same mass as the original electron/positron pair.

Thanks. So, only considering rest masses, if a battery is charged with 50 kWh of energy and weighs 1.000… kg, its total energy is:
1.000… * c^2
and not
50 kWh + 1.000… * c^2?

And I don’t get the electron/positron example. What kind of mass does the photons have that contribute to the mass of the system?

I’m not sure what you mean by “what kind of mass”. What kinds of mass are you thinking of?

But the key is that the mass isn’t a property of either photon individually; it’s a property of the pair of them.