Does a compressed spring weigh more than an uncompressed spring? The answer is surprisingly yes!
To understand why this is the case, we only need to look at the famous equation, e=mc². Since energy is directly related to mass, adding energy to a system affects the mass the following way: m=e/c². So if we were were to add 1,000 joules of potential energy to a spring, its mass would increase by 1,000 / c² or 1.113 × 10^-14 grams.
The same principle can be applied any time we add energy to a system. For example, heating an object increases its mass, and accelerating an object increases its mass as well. In fact, the reason why it is impossible to go the speed of light is because as an object approaches the speed of light, its mass increases so much that the engines require more and more energy to increase its speed. Accelerating to the speed of light would take an infinite amount of energy.
While these concepts go against common sense, the mathematics behind them are sound.