The gravitational binding energy of an object is the amount of energy required to accelerate every component of that object to the escape velocity of every other component. It is also the amount of energy that is liberated (usually in the form of heat) during the accretion of such an object from material falling from infinity.

For a uniform, spherical mass, the gravitational binding energy is

Where G is the gravitational constant, M is the mass of the sphere, and r is the radius of the sphere.

Assuming that Earth is uniform (which is not correct, but is close enough to get an order-of-magnitude estimate) with M = 5.97×1024kg and r = 6.37×106m, U is 2.24×1032J. This is roughly equal to one week of the Sun's total energy output.

According to the Virial theorem, the gravitational binding energy of a star is -2 times its internal thermal energy.