Electrical Conduit Size Calculator -

function calculateConduit() if (wires.length === 0) document.getElementById('resultArea').innerHTML = `<div class="conduit-size-result" style="background:#f1f5f9;">⚠️ No wires added</div>`; document.getElementById('fillDetails').innerHTML = ''; return; const conduitType = document.getElementById('conduitType').value; let sparePercent = parseFloat(document.getElementById('sparePercent').value); if (isNaN(sparePercent)) sparePercent = 0; const totalWireArea = computeTotalArea(); const numWires = wires.length; const fillLimit = getFillPercentLimit(numWires); const requiredArea = totalWireArea / fillLimit; const spareMultiplier = 1 + (sparePercent / 100); const finalRequiredArea = requiredArea * spareMultiplier; const areaMap = conduitAreas[conduitType]; if (!areaMap) document.getElementById('resultArea').innerHTML = `<div class="conduit-size-result">Error: conduit data</div>`; return; let selectedSize = null; for (let sz of tradeSizes) if (areaMap[sz] >= finalRequiredArea) selectedSize = sz; break; const fillPercentActual = (totalWireArea / (selectedSize ? areaMap[selectedSize] : 0.01)) * 100; const fillPercentLimited = fillLimit * 100; const resultDiv = document.getElementById('resultArea'); const fillDetailsDiv = document.getElementById('fillDetails'); const warningDiv = document.getElementById('warningMsg'); if (selectedSize) Required area with spare: $finalRequiredArea.toFixed(4) in²</div> <div>🔢 Number of conductors: $numWires</div> `; if (fillPercentActual > fillLimit*100 + 0.5) warningDiv.style.display = 'block'; warningDiv.innerHTML = `⚠️ Warning: Actual fill ($fillPercentActual.toFixed(1)%) exceeds NEC $fillLimit*100% limit. Choose larger conduit.`; else warningDiv.style.display = 'none'; else resultDiv.innerHTML = `<div class="conduit-size-result" style="background:#ffe6e5; color:#a1301a;">❌ No standard conduit size up to 4" fits these wires.<br>Consider larger conduit or reducing wires.</div>`; fillDetailsDiv.innerHTML = `<div>Total area needed: $finalRequiredArea.toFixed(4) in² exceeds max 4" conduit area ($areaMap["4"]?.toFixed(3) )</div>`; warningDiv.style.display = 'none';

<script> // ---------- AREA DATABASE (sq inches) based on NEC Table 5 (THHN/THWN & XHHW approx) ---------- const wireAreas = // AWG sizes, compact "14": "THHN": 0.0097, "THWN": 0.0097, "XHHW": 0.0123 , "12": "THHN": 0.0133, "THWN": 0.0133, "XHHW": 0.0160 , "10": "THHN": 0.0211, "THWN": 0.0211, "XHHW": 0.0243 , "8": "THHN": 0.0366, "THWN": 0.0366, "XHHW": 0.0410 , "6": "THHN": 0.0507, "THWN": 0.0507, "XHHW": 0.0590 , "4": "THHN": 0.0824, "THWN": 0.0824, "XHHW": 0.0937 , "2": "THHN": 0.1158, "THWN": 0.1158, "XHHW": 0.1320 , "1": "THHN": 0.1562, "THWN": 0.1562, "XHHW": 0.1780 , "1/0": "THHN": 0.1855, "THWN": 0.1855, "XHHW": 0.2110 , "2/0": "THHN": 0.2223, "THWN": 0.2223, "XHHW": 0.2540 , "3/0": "THHN": 0.2679, "THWN": 0.2679, "XHHW": 0.3050 , "4/0": "THHN": 0.3195, "THWN": 0.3195, "XHHW": 0.3650 , "250": "THHN": 0.3970, "THWN": 0.3970, "XHHW": 0.4540 , "350": "THHN": 0.5242, "THWN": 0.5242, "XHHW": 0.6010 , "500": "THHN": 0.7073, "THWN": 0.7073, "XHHW": 0.8120 ; electrical conduit size calculator

function computeTotalArea() let total = 0; for (let w of wires) const areaObj = wireAreas[w.size]; if (areaObj && areaObj[w.insulation]) total += areaObj[w.insulation]; else if (areaObj && areaObj["THHN"]) total += areaObj["THHN"]; else total += 0.0133; // fallback return total; function calculateConduit() if (wires

function getFillPercentLimit(numWires) if (numWires === 1) return 0.53; if (numWires === 2) return 0.31; return 0.40; // 3+ wires Actual conduit fill depends on insulation and jamming rules

<div class="result-panel"> <h3 style="margin-top:0;">📊 Result</h3> <div class="result-card"> <div id="resultArea"> <div class="conduit-size-result" style="background:#f1f5f9; color:#2d3e50;"> -- / -- </div> <div id="fillDetails"></div> </div> </div> <div class="warning" id="warningMsg" style="display:none;"></div> <div class="note"> <strong>⚡ NEC Fill Reference (typical):</strong> <ul style="margin:8px 0 0 16px; padding-left:0;"> <li>1 conductor → 53% max fill</li> <li>2 conductors → 31% max fill</li> <li>3+ conductors → 40% max fill</li> </ul> <small>*Based on standard THHN/THWN area values. Actual conduit fill depends on insulation and jamming rules.</small> </div> </div> </div>

function addWire() wires.push( size: "12", insulation: "THHN" ); renderWireInputs();