From a chip operation to the electricity bill
Electricity is sold by the kilowatt-hour, and a chip or a server rack is specified by the energy of its operations. People who estimate the running cost of a computing job, a sensor network or a storage system have to link the two. A single memory access may cost tens of nanojoules, and a bill covers many trillions of them. This page divides a nanojoule value by 3.6 × 10^15 and shows the result in kilowatt-hours, so a per-event figure can be turned into something that can be priced. It serves engineers, students and anyone who wants to see how a small unit adds up to the amount that appears on the meter.
Why the factor is 3.6 million times a billion
One kilowatt-hour is 1,000 W for 3,600 s, which is 3,600,000 J. One joule is 10^9 nJ, so a kilowatt-hour is 3.6 × 10^15 nJ, or 3,600,000,000,000,000 nJ. The formula is kWh = nJ × 2.77777777778e-16. The nanojoule prefix comes from the BIPM SI Brochure, and the kilowatt-hour definition follows from the SI units of watt and hour as listed in NIST SP 811. The hour is not an SI unit, but it is accepted for use with SI. The factor repeats a 7 and shows an approximation of the repeating decimal 2.7777..., so the page keeps full precision internally and rounds only for display.
A chip event priced at 2.78 × 10^-15 kWh
The page opens with 10 nJ and returns 2.777777777777778e-15 kWh, which is about 2.78 × 10^-15 kWh. The figure is too small to appear on any bill, and it simply shows the scale. A thousand times as many events would give 2.78 × 10^-12 kWh. To make a price visible, you need a trillion operations or more. That is also why billing for a server is based on measured power over time instead of a count of operations. When you write this number in a document, give two or three significant figures and the exponent, for example 2.78 × 10^-15 kWh, and avoid the long string that the floating-point output shows.
A phone battery in nanojoules
A phone battery rated at 15 Wh holds 0.015 kWh, which is 54,000 J or 54,000,000,000,000 nJ, and the page returns 0.015 kWh for that input. Divided by a 20 nJ access cost (illustrative), the energy would cover 2.7 × 10^12 such accesses if nothing else drew power, though the screen and radios use far more. At an illustrative 16 cents per kWh, a full charge of that battery costs about a quarter of a cent. Such a figure ties a very small unit to a familiar object and gives a sense of proportion. Remember that charger losses mean a wall meter reads more than the battery capacity.
Pricing a long computing job
Consider a job that performs 10^15 memory accesses at 20 nJ each, with 2 × 10^16 nJ in total (illustrative inputs). The page converts that to 5.5556 kWh. At an illustrative price of 16 cents per kWh, the memory part of the cost is about 89 cents. The real cost of a job includes processors, cooling, networking and the power delivery overhead of the facility, which operators often express as a ratio over the IT load. Using this page for the memory term and adding your measured power for the other parts gives a more realistic estimate. Always take the tariff from your own utility bill, since it varies with the region and the time of use. Some tariffs also add fixed monthly charges, which do not depend on the energy used and so do not belong in a per-operation figure.
Going from kilowatt-hours to nanojoules
Choose kilowatt-hour as the source to reverse the conversion. One kilowatt-hour is 3,600,000,000,000,000 nJ. A 0.25 kWh figure from a smart plug is 9 × 10^14 nJ, and a monthly use of 120 kWh is 4.32 × 10^17 nJ. These large numbers are used in simulations, where energy is accumulated in integer nanojoules to avoid floating-point drift. If a program reports a kilowatt-hour as a different count of nanojoules, check for an extra factor of 1,000 or a mix-up between kilowatt-hours and watt-hours, which are common sources of error. The page makes a quick reference point for such a test.
Energy and power are different things
A kilowatt-hour is an amount of energy, and a kilowatt is a rate. A device rated at 1 kW uses 1 kWh when it runs for an hour. Nanojoules measure the amount, so the pairing is natural, whereas a figure in nanowatts or microwatts would need a duration. A common slip in articles is to write kWh per hour or kW per day. If you have an average power, multiply by the time in hours to get kilowatt-hours first. For example, a 50 mW sensor running for a day (24 h) uses 0.0012 kWh. Then convert that to nanojoules with this page if a comparison with per-event figures is needed.
Smart plug displays and standby loads
Plug-in energy meters usually show kilowatt-hours in steps of 0.001, which is one watt-hour or 3,600,000,000,000 nJ. A device with a standby draw of 0.5 W uses 12 Wh over a day, so its tally rises by 0.012 kWh in that time. The conversion helps you see why a meter shows zero change over a short test: a single wake-up of a few thousand nanojoules is far below the display step. To measure small loads, run the meter for several days, or use a profiler that records current at a high rate and integrates it to energy. Then use this page to place the per-event result next to the meter reading and to check whether the two sources agree.
What a bill estimate still needs
A converted energy value carries no price information. It does not know a tariff, a time-of-use schedule, a demand charge, the efficiency of a power supply or the idle power of a system. A figure of 2.78 × 10^-15 kWh for 10 nJ is physically correct and tells you nothing about what a service costs, because a real device draws power between events. For a cost estimate, use a measured average power and your own price per kilowatt-hour. For a design decision about cooling or electrical capacity, follow the equipment documentation and local codes, and consult a qualified person. The converter keeps the unit arithmetic correct and leaves the rest to you. If you publish an energy figure, state the unit, the number of significant digits you trust and the source of the original reading, so that a reader can repeat the calculation.