In 2005, total worldwide energy consumption was 500 Exajoules (= 5 x 1020 J) with 80-90% derived from the combustion of fossil fuels. This is equivalent to an average energy consumption rate of 16 TW (= 1.585 x 1013 W). Not all of the world's economies track their energy consumption with the same rigor, and the exact energy content of a barrel of oil or a ton of coal will vary with quality.
Most of the world's energy resources are from the sun's rays hitting earth - some of that energy has been preserved as fossil energy, some is directly or indirectly usable e.g. via wind, hydro or wave power. The term solar constant is the amount of incoming solar electromagnetic radiation per unit area, measured on the outer surface of Earth's atmosphere, in a plane perpendicular to the rays. The solar constant includes all types of solar radiation, not just visible light. It is measured by satellite to be roughly 1366 watts per square meter, though it fluctuates by about 6.9% during a year - from 1412 W/m2 in early January to 1321 W/m2 in early July, due to the Earth's varying distance from the sun, and by a few parts per thousand from day to day. For the whole Earth, with a cross section of 127,400,000 km², the total energy rate is 1.740×1017 W, plus or minus 3.5%. This 174 PW is the total rate of solar energy received by the planet; about half, 89 PW, reaches the Earth's surface.
The estimates of remaining worldwide energy resources vary, with the remaining fossil fuels totaling an estimated 0.4 YJ (1 YJ = 1024J) and the available nuclear fuel such as uranium exceeding 2.5 YJ. Fossil fuels range from 0.6-3 YJ if estimates of reserves of methane clathrates are accurate and become technically extractable. Mostly thanks to the Sun, the world also has a renewable usable energy flux that exceeds 120 PW (8,000 times 2004 total usage), or 3.8 YJ/yr, dwarfing all non-renewable resources.