Gravitational binding energy
The gravitational binding energy of an object consisting of loose material, held together by gravity alone, is the amount of energy required to pull all of the material apart, to infinity. 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.
The gravitational binding energy of a system is equal to the negative of the total gravitational potential energy, considering the system as a set of small particles. For a system consisting of a celestial body and a satellite, the gravitational binding energy will have a larger absolute value than the potential energy of the satellite with respect to the celestial body, because for the latter quantity, only the separation of the two components is taken into account, keeping each intact.
where G is the gravitational constant, M is the mass of the sphere, and r is its radius. This is 80% greater than the energy required to separate to infinity the two hemispheres of the spherical mass.
Assuming that the Earth is a uniform sphere (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. It is 37.5 MJ/kg, 60% of the absolute value of the potential energy per kilogram at the surface.
The actual depth-dependence of density, inferred from seismic travel times (see Adams–Williamson equation), is given in the Preliminary Reference Earth Model (PREM). Using this, the real gravitational binding energy of Earth can be calculated numerically to U = 2.487 · 1032 J
Derivation for a uniform sphere 
The gravitational binding energy of a sphere is found by imagining that it is pulled apart by successively moving spherical shells to infinity, the outermost first, and finding the total energy needed for that.
If we assume a constant density then the masses of a shell and the sphere inside it are:
The required energy for a shell is the negative of the gravitational potential energy:
Integrating over all shells we get:
Remembering that is simply equal to the mass of the whole divided by its volume for objects with uniform density we get:
And finally, plugging this into our result we get:
Non-uniform spheres 
Planets and stars have radial density gradients from their lower density surfaces to their much larger density compressed cores. Degenerate matter objects (white dwarfs; neutron star pulsars) have radial density gradients plus relativistic corrections.
Neutron star relativistic equations of state provided by Jim Lattimer include a graph of radius vs. mass for various models. The most likely radii for a given neutron star mass are bracketed by models AP4 (smallest radius) and MS2 (largest radius). BE is the ratio of gravitational binding energy mass equivalent to observed neutron star gravitational mass of "M" kilograms with radius "R" meters,
Given current values
and star masses "M" commonly reported as multiples of one solar mass,
then the relativistic fractional binding energy of a neutron star is
See also 
- Chandrasekhar, S. 1939, An Introduction to the Study of Stellar Structure (Chicago: U. of Chicago; reprinted in New York: Dover), section 9, eqs. 90-92, p. 51 (Dover edition)
- Lang, K. R. 1980, Astrophysical Formulae (Berlin: Springer Verlag), p. 272
- Dziewonski, A. M.; Anderson, D. L.. "Preliminary Reference Earth Model". Physics of the Earth and Planetary Interiors 25: 297–356.
- Neutron Star Masses and Radii, p. 9/20, bottom
- Measurement of Newton's Constant Using a Torsion Balance with Angular Acceleration Feedback , Phys. Rev. Lett. 85(14) 2869 (2000)