Calculate the battery capacity required to run your load.
12 Volts
24 Volts
48 Volts
Custom Voltage
Lead Acid / AGM / Gel (50% DoD)
Lithium / LiFePO4 (80% DoD)
Custom Efficiency
Total Energy Required:0 Wh
Base Capacity Drawn:0 Ah
Recommended Battery Size:0 Ah
Based on battery chemistry safety margins.
// Handle custom voltage input visibility
document.getElementById('systemVoltage').onchange = function() {
var val = this.value;
var customInput = document.getElementById('customVoltageGroup');
if(val === 'custom') {
customInput.style.display = 'block';
} else {
customInput.style.display = 'none';
}
};
function calculateBatteryCapacity() {
// Get Inputs
var watts = parseFloat(document.getElementById('loadWatts').value);
var hours = parseFloat(document.getElementById('durationHours').value);
var voltSelect = document.getElementById('systemVoltage').value;
var type = document.getElementById('batteryType').value;
// Determine Voltage
var volts = 0;
if(voltSelect === 'custom') {
volts = parseFloat(document.getElementById('customVoltage').value);
} else {
volts = parseFloat(voltSelect);
}
// Validation
if (isNaN(watts) || isNaN(hours) || isNaN(volts) || volts <= 0) {
alert("Please enter valid numbers for Watts, Hours, and Voltage.");
return;
}
// 1. Calculate Total Watt Hours (Wh)
var totalWh = watts * hours;
// 2. Calculate Drawn Amp Hours (Ah) = Wh / Volts
var drawnAh = totalWh / volts;
// 3. Apply Depth of Discharge (DoD) Factor
var recommendedAh = 0;
var noteText = "";
if (type === 'lead') {
// Lead Acid should not be discharged below 50%
recommendedAh = drawnAh * 2;
noteText = "Calculated for Lead Acid/AGM (50% max depth of discharge) to prolong lifespan.";
} else if (type === 'lithium') {
// Lithium can safely discharge to 80% (some say 100%, but 80% is prudent for sizing)
recommendedAh = drawnAh / 0.8;
noteText = "Calculated for Lithium LiFePO4 (80% safe depth of discharge).";
} else {
// Generic 100% calculation if they want raw numbers
recommendedAh = drawnAh;
noteText = "Raw capacity calculation (100% efficiency assumed).";
}
// Display Results
document.getElementById('resWattHours').innerText = totalWh.toFixed(1) + " Wh";
document.getElementById('resDrawnAh').innerText = drawnAh.toFixed(2) + " Ah";
document.getElementById('resRecAh').innerText = Math.ceil(recommendedAh) + " Ah";
document.getElementById('resNote').innerText = noteText;
document.getElementById('resultBox').style.display = 'block';
}
How to Calculate Battery Amp Hours (Ah)
Understanding Amp Hours (Ah) is critical when sizing a battery bank for solar setups, RVs, boats, or backup power systems. An amp hour is a unit of electric charge that tells you how much current a battery can provide over one hour. Calculating the correct size ensures you don't run out of power or damage your batteries by draining them too deeply.
The Basic Formula
To calculate the Amp Hours you need, you first need to determine the total energy consumption in Watt-hours (Wh), and then divide by the voltage of your battery.
Amp Hours (Ah) = (Watts × Hours) ÷ Volts
Step-by-Step Calculation Guide
1. Determine Total Wattage
List every device you plan to power. Look for the label on the back of the appliance to find its power rating in Watts (W). If you only have Amps and Volts, multiply them to get Watts ($Watts = Amps \times Volts$).
2. Estimate Runtime
Estimate how many hours per day you will run each device. Be realistic. If a fridge runs 24 hours a day but the compressor only cycles on for 20 minutes every hour, your actual runtime is 8 hours (24 / 3).
3. Convert to Amp Hours
Multiply the Watts by the Hours to get Watt-hours. Then, divide by your system voltage (usually 12V, 24V, or 48V). This gives you the raw Amp Hours consumed.
Critical Factor: Depth of Discharge (DoD)
This is where most beginners make mistakes. You cannot use 100% of a battery's rated capacity without damaging it (unless it is a very specific type). You must oversizing your battery bank based on the chemistry:
Lead Acid / AGM / Gel: These should generally not be discharged below 50%. Therefore, you need a battery with double the capacity of your calculated usage.
Lithium (LiFePO4): These are more efficient and can typically be discharged to 80% or even 90% safely. You need a battery roughly 1.25x your calculated usage.
Example Calculation
Let's say you want to run a 60 Watt laptop charger for 5 hours on a 12V Lead Acid battery.
Total Energy: 60W × 5 hours = 300 Watt-hours (Wh).
Current Draw: 300Wh ÷ 12V = 25 Amp Hours (Ah).
Battery Sizing: Since it is Lead Acid (50% DoD), multiply by 2.
Result: You need a 12V battery with at least 50 Ah capacity.
Why Voltage Matters
As you increase voltage, the required Amp Hours decrease for the same amount of power. For example, 1200Wh at 12V requires 100Ah. That same 1200Wh at 24V only requires 50Ah. This is why larger systems often use 24V or 48V to keep cable thickness manageable.