Wire Sizing Calculator
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f4f7f6;
color: #333;
line-height: 1.6;
margin: 0;
padding: 20px;
display: flex;
justify-content: center;
align-items: flex-start;
min-height: 100vh;
}
.loan-calc-container {
background-color: #ffffff;
border-radius: 8px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
padding: 30px;
width: 100%;
max-width: 700px;
box-sizing: border-box;
margin-bottom: 30px;
}
h1, h2 {
color: #004a99;
text-align: center;
margin-bottom: 20px;
}
.input-group {
margin-bottom: 20px;
display: flex;
align-items: center;
gap: 15px;
flex-wrap: wrap;
}
.input-group label {
flex: 0 0 180px; /* Fixed width for labels */
font-weight: 600;
color: #004a99;
text-align: right;
}
.input-group input[type="number"],
.input-group select {
flex: 1;
min-width: 180px; /* Ensure inputs have space to grow */
padding: 10px 12px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1rem;
box-sizing: border-box;
}
.input-group select {
cursor: pointer;
}
button {
background-color: #004a99;
color: white;
border: none;
padding: 12px 25px;
border-radius: 5px;
font-size: 1.1rem;
cursor: pointer;
transition: background-color 0.3s ease;
display: block;
margin: 20px auto 0 auto;
width: 100%;
max-width: 200px;
}
button:hover {
background-color: #003366;
}
#result {
margin-top: 30px;
padding: 20px;
background-color: #e9ecef;
border-radius: 8px;
text-align: center;
border: 1px solid #ced4da;
}
#result h3 {
margin-top: 0;
color: #004a99;
}
#result-value {
font-size: 1.8rem;
font-weight: bold;
color: #28a745;
margin-top: 10px;
}
.explanation {
margin-top: 40px;
background-color: #ffffff;
border-radius: 8px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
padding: 30px;
width: 100%;
max-width: 700px;
box-sizing: border-box;
}
.explanation h2 {
text-align: left;
margin-bottom: 15px;
}
.explanation p, .explanation ul {
margin-bottom: 15px;
}
.explanation ul {
padding-left: 20px;
}
.explanation li {
margin-bottom: 8px;
}
@media (max-width: 600px) {
.input-group {
flex-direction: column;
align-items: stretch;
}
.input-group label {
flex: none;
text-align: left;
margin-bottom: 5px;
width: auto;
}
.input-group input[type="number"],
.input-group select {
width: 100%;
min-width: unset;
}
}
Understanding Wire Sizing
Proper wire sizing is crucial for electrical safety, efficiency, and performance. Undersized wires can overheat, leading to fire hazards, insulation damage, and inefficient power delivery due to voltage drop. Oversized wires, while safe, can be more expensive and difficult to install.
Key Factors in Wire Sizing:
- Current Carrying Capacity (Ampacity): This is the maximum current a conductor can carry continuously under specific conditions without exceeding its temperature rating. Factors influencing ampacity include the wire material (copper vs. aluminum), insulation type, ambient temperature, and whether the wires are in conduit or free air.
- Voltage Drop: As current flows through a wire, it encounters resistance, causing a loss of voltage along the length of the conductor. Excessive voltage drop can impair the performance of electrical equipment. National electrical codes often specify a maximum allowable voltage drop for different types of circuits.
- Circuit Length: Longer circuits have higher resistance, contributing more to voltage drop.
- Wire Material: Copper is a better conductor than aluminum, meaning it has lower resistance for the same cross-sectional area.
- Ambient Temperature: Higher ambient temperatures reduce the ampacity of a wire because there is less capacity for heat dissipation.
Calculation Logic:
This calculator uses a simplified approach combining ampacity and voltage drop considerations. It first determines the required conductor size based on the necessary ampacity, considering temperature derating. Then, it checks if this size meets the allowable voltage drop requirement. If not, it suggests a larger wire size.
Ampacity Calculation Basis: The calculator refers to standard ampacity tables (like those in the NEC – National Electrical Code) and applies temperature correction factors. The insulation type determines the base temperature rating (e.g., 60°C, 75°C, 90°C).
Voltage Drop Formula: The voltage drop (VD) in volts is calculated using:
VD = (2 * K * L * I) / CM (for single-phase circuits)
Where:
- K = Resistivity of the conductor (approx. 12.9 ohm-cmil/ft for copper, 21.2 ohm-cmil/ft for aluminum at 20°C, adjusted for temperature).
- L = Length of the circuit in feet (converted from meters).
- I = Current in Amperes.
- CM = Circular Mils (cross-sectional area of the wire).
The calculator converts the result to a percentage of the supply voltage.
How to Use:
- Enter the maximum continuous current (in Amperes) the circuit will carry.
- Specify the maximum allowable voltage drop as a percentage of the supply voltage.
- Input the total length of the circuit run from the source to the load in meters.
- Select the type of wire material (Copper or Aluminum).
- Enter the expected ambient temperature in degrees Celsius.
- Choose the wire's insulation type, which dictates its temperature rating and base ampacity.
- Click "Calculate Wire Size" to get the recommended wire size (typically in AWG or kcmil/MCM).
Disclaimer: This calculator provides an estimate based on common standards. Always consult local electrical codes, experienced electricians, and the specific product datasheets for critical applications. Incorrect wiring can be dangerous.
// Resistivity values at 20°C (ohm-cmil/ft)
var kValues = {
'copper': 12.9,
'aluminum': 21.2
};
// Standard Ampacity Tables (NEC – approximation for THHN/THWN @ 75°C for copper, 1 AWG=100 kcmil, 2 AWG=67 kcmil, etc.)
// This is a simplified lookup. Real tables are more complex and account for conduit fill, etc.
// Values are Amps for specific AWG/kcmil sizes at 75°C rated insulation.
var ampacityTable = {
'copper': {
'18': 14, // Not typically used for power circuits
'16': 18, // Not typically used for power circuits
'14': 25,
'12': 30,
'10': 35,
'8': 50,
'6': 75,
'4': 95,
'3': 110,
'2': 125,
'1': 145,
'1/0': 170,
'2/0': 195,
'3/0': 225,
'4/0': 260,
'250': 295,
'300': 320,
'350': 350,
'400': 375,
'500': 420,
'600': 460,
'700': 490,
'750': 510,
'800': 530,
'900': 555,
'1000': 575
},
'aluminum': {
'12': 20,
'10': 25,
'8': 35,
'6': 50,
'4': 65,
'3': 75,
'2': 85,
'1': 100,
'1/0': 115,
'2/0': 130,
'3/0': 150,
'4/0': 175,
'250': 200,
'300': 220,
'350': 240,
'400': 260,
'500': 300,
'600': 320,
'700': 345,
'750': 355,
'800': 370,
'900': 385,
'1000': 400
}
};
// Temperature Correction Factors (example values, may vary by standard)
// Based on 30°C ambient for 75°C rated wire
var tempCorrectionFactors = {
'copper': {
'60': { // TW/UF rated 60C
'20': 1.15, '25': 1.08, '30': 1.00, '35': 0.92, '40': 0.84, '45': 0.75, '50': 0.67, '55': 0.58, '60': 0.42
},
'75': { // THW/THWN/THHN rated 75C
'20': 1.18, '25': 1.13, '30': 1.05, '35': 1.00, '40': 0.94, '45': 0.88, '50': 0.82, '55': 0.75, '60': 0.67, '70': 0.55, '80': 0.43, '90': 0.30
},
'90': { // XHHW rated 90C
'20': 1.10, '25': 1.05, '30': 1.00, '35': 0.95, '40': 0.89, '45': 0.84, '50': 0.79, '55': 0.74, '60': 0.68, '70': 0.59, '80': 0.50, '90': 0.41
}
},
'aluminum': {
'60': { // TW/UF rated 60C
'20': 1.18, '25': 1.10, '30': 1.00, '35': 0.91, '40': 0.82, '45': 0.73, '50': 0.63, '55': 0.54, '60': 0.43
},
'75': { // THW/THWN/THHN rated 75C
'20': 1.20, '25': 1.15, '30': 1.08, '35': 1.02, '40': 0.96, '45': 0.90, '50': 0.84, '55': 0.77, '60': 0.70, '70': 0.59, '80': 0.48, '90': 0.35
},
'90': { // XHHW rated 90C
'20': 1.10, '25': 1.05, '30': 1.00, '35': 0.95, '40': 0.90, '45': 0.85, '50': 0.80, '55': 0.75, '60': 0.70, '70': 0.60, '80': 0.50, '90': 0.40
}
}
};
// AWG to Circular Mil (CM) conversion (approximate)
var awgToCm = {
'18': 16200,
'16': 25800,
'14': 41100,
'12': 65300,
'10': 103800,
'8': 165100,
'6': 262400,
'4': 417400,
'3': 526200,
'2': 663600,
'1': 836900,
'1/0': 105600, // 105,600 kcmil
'2/0': 133100, // 133,100 kcmil
'3/0': 167800, // 167,800 kcmil
'4/0': 211600, // 211,600 kcmil
'250': 250000,
'300': 300000,
'350': 350000,
'400': 400000,
'500': 500000,
'600': 600000,
'700': 700000,
'750': 750000,
'800': 800000,
'900': 900000,
'1000': 1000000
};
// Reverse lookup for practical AWG/kcmil sizes
var cmToAwg = Object.entries(awgToCm).map(([key, value]) => ({ cm: value, awg: key })).sort((a, b) => a.cm – b.cm);
function calculateWireSize() {
var currentAmps = parseFloat(document.getElementById('currentAmps').value);
var voltageDropPercent = parseFloat(document.getElementById('voltageDrop').value);
var circuitLengthMeters = parseFloat(document.getElementById('circuitLength').value);
var wireMaterial = document.getElementById('wireMaterial').value;
var temperature = parseInt(document.getElementById('temperature').value);
var insulationType = document.getElementById('insulationType').value; // This is the temperature rating
var resultDiv = document.getElementById('result-value');
var explanationDiv = document.getElementById('result-explanation');
resultDiv.innerText = '–';
explanationDiv.innerText = ";
// Input Validation
if (isNaN(currentAmps) || currentAmps <= 0 ||
isNaN(voltageDropPercent) || voltageDropPercent 10 ||
isNaN(circuitLengthMeters) || circuitLengthMeters <= 0 ||
isNaN(temperature) || temperature 100) {
explanationDiv.innerText = "Please enter valid positive numbers for all inputs. Voltage drop should be between 1% and 10%.";
return;
}
var circuitLengthFeet = circuitLengthMeters * 3.28084;
var k = kValues[wireMaterial];
var tempFactor = tempCorrectionFactors[wireMaterial][insulationType][temperature];
if (tempFactor === undefined) {
explanationDiv.innerText = "Temperature correction factor not available for the selected material, insulation type, and temperature.";
return;
}
// Find the smallest wire size that meets ampacity requirement after derating
var requiredCm = 0;
var recommendedSize = "N/A";
var baseAmpacity = 0;
var adjustedAmpacity = 0;
var tempRatedAmpacity = parseFloat(insulationType); // This is interpreted as the base temp rating, not ampacity itself
// Iterate through ampacity table to find a suitable wire size
var availableSizes = Object.keys(ampacityTable[wireMaterial]).sort((a, b) => {
// Custom sort for AWG sizes (e.g., 1/0 before 2)
if (a.includes('/') && b.includes('/')) {
var numA = parseInt(a.split('/')[0]);
var numB = parseInt(b.split('/')[0]);
if (numA numB) return 1;
return 0;
} else if (a.includes('/')) {
return -1; // a (e.g., 1/0) comes before b (e.g., 2)
} else if (b.includes('/')) {
return 1; // b (e.g., 1/0) comes before a (e.g., 2)
}
return parseInt(a) – parseInt(b);
});
var initialAmpacityCheckSize = null;
for (var i = 0; i = currentAmps) {
initialAmpacityCheckSize = size;
requiredCm = sizeCm;
baseAmpacity = rawAmpacity; // Storing approximate base ampacity for info
adjustedAmpacity = deratedAmpacity;
break; // Found the smallest wire that meets ampacity
}
}
if (!initialAmpacityCheckSize) {
explanationDiv.innerText = "Could not find a wire size that meets the ampacity requirement based on the provided inputs and standard tables.";
return;
}
// Now check voltage drop with the size found from ampacity
var vdVolts = (2 * k * circuitLengthFeet * currentAmps) / requiredCm;
// Assuming a standard voltage, e.g., 120V or 240V. Let's prompt user or assume 120V for calculation.
// For generality, let's assume a typical residential voltage like 120V for percentage calculation.
// A better calculator would ask for system voltage.
var systemVoltage = 120; // Defaulting to 120V for percentage calculation example
var vdPercent = (vdVolts / systemVoltage) * 100;
var finalSize = initialAmpacityCheckSize;
var finalCm = requiredCm;
// If voltage drop is too high, find a larger wire size that meets both
if (vdPercent > voltageDropPercent) {
for (var j = availableSizes.indexOf(initialAmpacityCheckSize) + 1; j = currentAmps) {
// Check voltage drop for this larger wire
var vdVoltsLarger = (2 * k * circuitLengthFeet * currentAmps) / largerCm;
var vdPercentLarger = (vdVoltsLarger / systemVoltage) * 100;
if (vdPercentLarger <= voltageDropPercent) {
finalSize = largerSize;
finalCm = largerCm;
break; // Found the smallest wire that meets both criteria
}
}
}
}
resultDiv.innerText = finalSize;
explanationDiv.innerHTML = `
Calculation Details:
– Material: ${wireMaterial.charAt(0).toUpperCase() + wireMaterial.slice(1)}
– Insulation Temp Rating: ${insulationType}°C
– Ambient Temp: ${temperature}°C
– Temperature Correction Factor: ${tempFactor ? tempFactor.toFixed(2) : 'N/A'}
– Circuit Length: ${circuitLengthMeters} m (${circuitLengthFeet.toFixed(1)} ft)
– Required Ampacity: ${currentAmps} A
– Initial Ampacity Check Size (based on ampacity): ${initialAmpacityCheckSize} (Adjusted Ampacity: ${adjustedAmpacity.toFixed(1)} A)
– Final Recommended Size: ${finalSize} (CM: ${finalCm.toLocaleString()})
– Calculated Voltage Drop for ${finalSize}: ${vdVolts.toFixed(2)} V (${vdPercent.toFixed(2)}% of ${systemVoltage}V)
– Allowable Voltage Drop: ${voltageDropPercent}%
Note: Voltage drop calculated assuming ${systemVoltage}V system. Always verify with local codes.
`;
}