Battery Capacity Calculator
Calculate the required battery capacity (mAh) for your project based on desired runtime, load current, and safety factor. Size your battery correctly for reliable operation. See also our Battery Life Calculator and Solar Panel Calculator.
How to Calculate Required Battery Capacity
Determining the correct battery capacity is a critical step in designing any portable or battery-backed system. Undersizing the battery leads to insufficient runtime and user frustration, while oversizing adds unnecessary weight, cost, and volume. The goal is to find the minimum capacity that meets your runtime requirements with adequate safety margin for real-world conditions.
The basic calculation multiplies the average load current by the desired runtime to get the minimum capacity, then applies a safety factor to account for battery aging, temperature effects, and manufacturing tolerances. A safety factor of 1.2 (20% extra) is typical for consumer electronics, while critical applications like medical devices or emergency systems may use 1.5 or higher.
For devices with variable current draw (like smartphones or IoT sensors), calculate the time-weighted average current across all operating modes. Include standby current, peak current during transmission, and any periodic high-current events. The average current over a complete duty cycle determines the battery capacity requirement.
Battery Capacity Formula
Required Capacity:
Capacity (mAh) = Current (mA) × Time (hours) × Safety Factor
With Multiple Operating Modes:
I_avg = Σ(I_mode × t_mode) / t_total
Capacity = I_avg × t_total × Safety Factor
Energy Approach:
Energy (Wh) = Capacity (Ah) × Voltage (V)
Capacity (Ah) = Energy (Wh) / Voltage (V)
Safety Factor Guidelines:
1.2 = Standard consumer electronics
1.3 = Outdoor/variable temperature
1.5 = Critical/medical applications
2.0 = Extreme conditions or long service life
Example Calculation
Design a battery for a portable sensor that needs to run for 10 hours at 500mA average current:
Given: Runtime = 10 hours, Current = 500 mA, Safety Factor = 1.2
Capacity = 500 × 10 × 1.2 = 6000 mAh = 6.0 Ah
Without safety factor: 500 × 10 = 5000 mAh
Safety margin: 20% extra = 1000 mAh buffer
Energy (Li-ion 3.7V): 6.0 × 3.7 = 22.2 Wh
Possible solution: 2× 18650 cells (3000mAh each) in parallel
With duty cycling (active 50%, sleep at 10mA):
I_avg = 500×0.5 + 10×0.5 = 255 mA
Capacity = 255 × 10 × 1.2 = 3060 mAh
Single 18650 cell (3000-3500mAh) would suffice
Battery Capacity Reference Table
| Runtime (h) | Current (mA) | Safety Factor | Capacity (mAh) |
|---|---|---|---|
| 1 h | 100 mA | 1.2 | 120 mAh |
| 2 h | 200 mA | 1.2 | 480 mAh |
| 5 h | 100 mA | 1.2 | 600 mAh |
| 8 h | 250 mA | 1.2 | 2400 mAh |
| 10 h | 500 mA | 1.2 | 6000 mAh |
| 12 h | 100 mA | 1.3 | 1560 mAh |
| 24 h | 50 mA | 1.2 | 1440 mAh |
| 24 h | 200 mA | 1.2 | 5760 mAh |
| 48 h | 100 mA | 1.3 | 6240 mAh |
| 72 h | 50 mA | 1.2 | 4320 mAh |
| 168 h | 10 mA | 1.5 | 2520 mAh |
| 720 h | 5 mA | 1.3 | 4680 mAh |
Frequently Asked Questions
What safety factor should I use?
Use 1.2 for indoor consumer electronics with stable temperature. Use 1.3 for outdoor devices or those exposed to temperature variations. Use 1.5 for critical applications (medical, safety, emergency). Use 2.0 for extreme environments or when the battery must last the entire product lifetime without replacement. The safety factor compensates for capacity loss due to aging, temperature, and discharge rate effects.
How do I account for variable current draw?
Calculate the time-weighted average: I_avg = (I₁×t₁ + I₂×t₂ + ... + Iₙ×tₙ) / (t₁+t₂+...+tₙ). For example, a device that draws 200mA for 1 second then sleeps at 1mA for 59 seconds has I_avg = (200×1 + 1×59)/60 = 4.3mA. This dramatically reduces the required battery capacity compared to continuous 200mA operation.
What is the difference between mAh and Wh?
mAh measures charge capacity (current × time), while Wh measures energy capacity (power × time). They are related by voltage: Wh = Ah × V. A 2000mAh battery at 3.7V stores 7.4Wh of energy. Wh is more useful for comparing batteries of different voltages, while mAh is more practical for calculating runtime at a known current draw from a specific battery voltage.
How does discharge rate affect usable capacity?
Higher discharge rates reduce usable capacity due to increased internal resistance losses and the Peukert effect. A battery rated at 2000mAh (at C/20 rate) might only deliver 1800mAh at 1C rate and 1500mAh at 2C rate. Li-ion batteries are less affected than lead-acid, but the effect is still significant at high rates. Check the datasheet for capacity vs. discharge rate curves.
Should I use series or parallel battery configurations?
Series connections increase voltage while maintaining the same capacity (mAh). Parallel connections increase capacity while maintaining the same voltage. For higher capacity at the same voltage, use parallel. For higher voltage (to match your circuit requirements), use series. Many designs use both: series for voltage, parallel for capacity (e.g., 2S3P = 2 series, 3 parallel = 6 cells total).
How do I choose between battery chemistries?
Li-ion/LiPo: highest energy density, best for portable electronics (3.7V/cell, 150-250 Wh/kg). NiMH: good for high-drain devices, no memory effect (1.2V/cell, 60-120 Wh/kg). Alkaline: lowest cost, no charging needed (1.5V/cell, 80-160 Wh/kg). LiFePO4: safest lithium, long cycle life (3.2V/cell, 90-120 Wh/kg). Lead-acid: cheapest per Wh, heavy (2V/cell, 30-50 Wh/kg).
Common Battery Sizes and Capacities
Standard 18650 Li-ion cells offer 2000-3500mAh at 3.7V. CR2032 coin cells provide about 220mAh at 3V. AA alkaline batteries have approximately 2500mAh at 1.5V. AAA alkaline batteries offer about 1000mAh. Smartphone batteries typically range from 3000-5000mAh. Power banks range from 5000-30000mAh. When selecting a battery, consider not just capacity but also physical size, weight, discharge rate capability, operating temperature range, and cycle life requirements.
Design Considerations
Beyond capacity, consider the battery's maximum continuous discharge rate (C-rating), peak pulse current capability, operating temperature range, self-discharge rate, cycle life, and physical constraints (size, weight, shape). Also factor in the charging infrastructure — how will the battery be recharged, how long is acceptable for charging, and what charging IC or circuit is needed. For products with long shelf life, consider primary (non-rechargeable) batteries which have much lower self-discharge rates than rechargeable cells.