Solar Cost
Solar Cost per kWh Generated Calculator
Work out the lifetime cost of each kWh a system generates
Updated July 12, 2026 · Live
What this tool does
Works out the levelised cost of each kWh a solar system generates over its life, and compares it against a grid price you enter.
Enter the system cost, annual generation, lifespan and maintenance; the calculator returns the lifetime cost per kWh and compares it with a grid price.
People also use
Formula Used
Formula Used
How the solar cost per kwh generated works
Lifetime generation is annual output times the number of years. Lifetime cost is the system cost plus yearly maintenance across the same period. Dividing lifetime cost by lifetime generation gives the levelised cost of each kWh the system produces. If you enter a grid price, the tool shows whether solar comes in cheaper or dearer per kWh.
The formula is cost per kWh = (Cost + m × y) ÷ (E × y), where m is maintenance per year, y is the lifespan in years and E is the annual generation in kWh. Worked example: a 6,000 system with 40 a year upkeep, generating 3,800 kWh a year for 25 years. Lifetime cost is 6,000 + 40 × 25 = 7,000. Lifetime generation is 3,800 × 25 = 95,000 kWh. Cost per kWh is 7,000 ÷ 95,000 = 0.074. Against a grid price of 0.27 that is cheaper by 0.196 per kWh.
What you enter
Enter the system cost, annual generation, lifespan and maintenance; the calculator returns the lifetime cost per kWh and compares it with a grid price. Every field is editable, and the result recalculates the moment you change a value. Currency is whatever you use, as long as the system cost, upkeep and grid price all use the same one. Nothing in the tool depends on metric or imperial units.
Reading the result
A cost per kWh below your grid price means the system generates cheaper energy than you buy. The comparison holds for energy you use yourself. Energy you export is usually paid at a different rate, and a system sized well above your use will have a lower value per kWh than the figure suggests.
Lifespan matters a lot. Over 20 years instead of 25 the default system costs (6,000 + 800) ÷ (3,800 × 20) = 0.089 per kWh, against 0.074 over 25. Check the lifespan against the warranty and your own judgment rather than assuming the longest figure.
A second example shows the effect of upkeep. A 10,000 system generating 5,000 kWh a year for 25 years with no maintenance costs 10,000 ÷ 125,000 = 0.080 per kWh. Add 100 a year for cleaning and an inverter fund and it becomes (10,000 + 2,500) ÷ 125,000 = 0.100. Upkeep that looks small each year adds up over the full life, so include it.
Compare like with like. The system cost should be the amount you actually pay, after any upfront rebate that applies to you, and it should include the inverter, mounting and installation. Ongoing charges such as insurance belong in maintenance. If you finance the purchase, interest is not included, so the real cost to you will be higher than this figure.
Safe by design
This calculator does the arithmetic of sizing: quantities, geometry and cost. It deliberately stops at the line a certified installer must sign off. It will never tell you a cable or fuse size, an earthing arrangement, a battery charge voltage, or a roof structural load. Those are regulated calculations where a wrong number can cause fire, electrocution or collapse. All electrical work must be carried out by a qualified, certified installer, and this page is not an installation guide.
Assumptions and limits
The result describes the whole life of the system as one average. It does not say when you break even, because it does not know how much of the energy you use or export, or what you would have paid for it. For that question you need the payback calculation, which needs your own usage and tariff.
The result is undiscounted: it does not apply an interest or inflation rate to future years. Discounting matters. At a 5% discount rate the default system comes to about 0.123 per kWh, not 0.074, because the up-front cost is spread over fewer discounted kWh. Panel output also falls slowly over the years, and a flat annual figure does not capture that. With a loss of 0.5% a year, the default system averages about 94% of its first-year output and the cost rises to roughly 0.078 per kWh.
Grid prices and tariffs change and are entered by you, not built in. Include an inverter replacement in the maintenance figure if you expect one. The NLR (formerly NREL) calculator and the US Energy Information Administration publish the full discounted method, which is the one used to compare power sources.
Using it with the rest of BuildMetricLab
This calculator is one step in planning a system. Pair it with the Solar Annual Yield Estimate calculator to get the annual generation, and with the other solar sizing and cost tools to go from an energy figure to a panel count and a costed bill of materials. Every BuildMetricLab tool runs in your browser, so nothing you type is sent anywhere, and the formula is shown on the page so you can check the maths.
Sources & methodology
The tool divides the lifetime cost by the lifetime generation. Lifetime generation = annual kWh × years. Lifetime cost = system cost + yearly maintenance × years. Cost per kWh = lifetime cost ÷ lifetime generation, the simple (undiscounted, constant-output) form of the levelised cost of energy. The full method, used by NLR (formerly NREL) and EIA, also discounts future costs and output. If you enter a grid price, the tool shows the difference per kWh. It does not discount future years, model panel degradation (typically a fraction of a percent a year), or add inverter replacement unless you include it in maintenance. No tariffs or prices are built in; every figure comes from you.
Frequently asked questions
What is levelised cost of energy?
It is the total lifetime cost divided by the total lifetime generation, so it is the average cost of each kWh the system produces over its life. With a 6,000 system, 40 a year upkeep, 3,800 kWh a year and 25 years, that is 7,000 ÷ 95,000 = 0.074 per kWh.
Does this account for interest or inflation?
No. It is a simple undiscounted figure and it assumes the same output every year. A full appraisal would discount future costs and generation, and would allow for panel degradation. On the default figures a 5% discount rate lifts the result from 0.074 to about 0.123 per kWh.
How does it compare with the grid?
Enter your grid price and the tool shows the difference per kWh. A solar cost below the grid price means the energy you generate costs less than energy you buy. The comparison only holds for the kWh you use yourself, because exported energy is usually paid at a different rate. Leave the grid price blank to hide the comparison.
Where do I get annual generation?
Use the Solar Annual Yield Estimate calculator with your own local peak sun hours, or take the figure from the records of a monitored system. A yield from a different climate or roof angle will mislead you, so use one that matches your site.
Spotted something off?
Calculations or display — let us know.













