<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 ;
let wireCount = 0; let wires = []; // store each wire object size, insulation
Here is the content for an page. This includes the HTML, CSS, and JavaScript for a fully functional tool, along with explanatory text for SEO and user guidance. File Name: conduit-size-calculator.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> <title>Electrical Conduit Size Calculator | NEC Compliant Fill Chart</title> <meta name="description" content="Free NEC-based electrical conduit size calculator. Determine minimum conduit size (EMT, PVC, Rigid) for copper and aluminum wires. Supports THHN, THWN, XHHW."> <style> * box-sizing: border-box; body font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; background: #f0f4f8; margin: 0; padding: 20px; color: #1a2a3a; .container max-width: 1100px; margin: 0 auto; background: white; border-radius: 28px; box-shadow: 0 20px 35px -12px rgba(0,0,0,0.15); overflow: hidden; padding: 20px 24px 40px 24px; h1 font-size: 1.9rem; margin-top: 0.2rem; margin-bottom: 0.2rem; color: #0b3b5f; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; h1 small font-size: 0.8rem; font-weight: normal; background: #e9ecef; padding: 4px 12px; border-radius: 40px; color: #2c3e50; .badge background: #1e5f7a; color: white; padding: 4px 12px; border-radius: 30px; font-size: 0.8rem; display: inline-block; .intro background: #eef2fa; padding: 16px 20px; border-radius: 24px; margin: 20px 0 24px 0; border-left: 5px solid #2c7da0; font-size: 1rem; line-height: 1.4; .calculator-grid display: flex; flex-wrap: wrap; gap: 30px; margin-bottom: 30px; .input-panel flex: 1.2; min-width: 260px; background: #f9fbfd; padding: 20px; border-radius: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); .result-panel flex: 1; min-width: 260px; background: #ffffff; border-radius: 24px; padding: 20px; border: 1px solid #dce5ef; box-shadow: 0 6px 14px rgba(0,0,0,0.03); .form-group margin-bottom: 20px; label font-weight: 600; display: block; margin-bottom: 8px; font-size: 0.9rem; color: #1f5068; select, input width: 100%; padding: 12px 14px; font-size: 1rem; border: 1.5px solid #cbd5e1; border-radius: 18px; background: white; transition: 0.2s; font-family: inherit; select:focus, input:focus border-color: #2c7da0; outline: none; box-shadow: 0 0 0 3px rgba(44,125,160,0.2); .wire-entry background: #ffffff; border-radius: 20px; padding: 12px; margin-bottom: 12px; border: 1px solid #e2e8f0; .wire-header display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: bold; .wire-controls display: flex; gap: 10px; flex-wrap: wrap; .wire-controls select, .wire-controls input flex: 1; padding: 8px 10px; font-size: 0.85rem; .btn-remove background: #ffe6e5; border: none; border-radius: 40px; padding: 6px 12px; font-size: 0.75rem; font-weight: bold; cursor: pointer; color: #b91c1c; .btn-add background: #e2f0f5; border: none; border-radius: 40px; padding: 10px 16px; font-weight: 600; cursor: pointer; margin: 8px 0 12px 0; width: 100%; font-size: 0.9rem; color: #1f5e7a; button background: #2c7da0; color: white; border: none; border-radius: 40px; padding: 12px 20px; font-weight: bold; font-size: 1rem; cursor: pointer; width: 100%; transition: 0.2s; button:hover background: #1f5e7a; .result-card text-align: center; margin: 15px 0; .conduit-size-result background: #e6f4ea; border-radius: 60px; padding: 20px; font-size: 2rem; font-weight: 800; color: #166534; margin: 20px 0; border: 1px solid #b8e0c2; .warning background: #fff3e0; border-left: 6px solid #f4a261; padding: 12px; border-radius: 16px; font-size: 0.85rem; margin: 15px 0; .fill-percent font-size: 1.2rem; font-weight: 600; hr margin: 24px 0; border: none; border-top: 2px dotted #cbd5e1; .note font-size: 0.85rem; color: #4a627a; background: #f8fafc; padding: 16px; border-radius: 20px; table width: 100%; border-collapse: collapse; font-size: 0.8rem; th, td text-align: left; padding: 8px 6px; border-bottom: 1px solid #e2e8f0; @media (max-width: 700px) .container padding: 16px; .conduit-size-result font-size: 1.5rem; </style> </head> <body> <div class="container"> <h1> 📏 Electrical Conduit Size Calculator <small>NEC Chapter 9 Table 1 & 4</small> </h1> <div class="intro"> ✅ <strong>How it works:</strong> Enter your wire gauges (AWG or kcmil), insulation type (THHN, THWN, XHHW), and number of conductors. The tool calculates the total cross-sectional area, applies NEC fill rules (40% for >2 wires, 31% for 2 wires, 53% for 1 wire), and suggests the smallest standard trade size conduit (EMT, PVC, Rigid, IMC). </div> <div class="calculator-grid"> <div class="input-panel"> <div class="form-group"> <label>📌 Conduit Type (Material)</label> <select id="conduitType"> <option value="EMT">EMT (Electrical Metallic Tubing)</option> <option value="PVC">PVC Schedule 40</option> <option value="RIGID">Rigid Metal Conduit (RMC)</option> <option value="IMC">IMC (Intermediate Metal Conduit)</option> </select> </div> <div class="form-group"> <label>⚡ Wire / Conductor Setup</label> <div id="wiresContainer"></div> <button type="button" class="btn-add" id="addWireBtn">+ Add another conductor</button> </div> <div class="form-group"> <label>📐 Spare / Future capacity (%)</label> <input type="number" id="sparePercent" value="0" step="5" min="0" max="50">% <small style="display:block;">Adds extra fill capacity for future wires</small> </div> <button id="calculateBtn">🔧 Calculate Minimum Conduit Size</button> </div> 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;
const tradeSizes = ["1/2", "3/4", "1", "1 1/4", "1 1/2", "2", "2 1/2", "3", "3 1/2", "4"]; <script> // ---------- AREA DATABASE (sq inches) based
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) let conduitInnerArea = areaMap[selectedSize]; resultDiv.innerHTML = ` <div class="conduit-size-result"> Trade Size: <strong>$selectedSize"</strong> $conduitType<br> <span style="font-size:1rem;">(inner area: $conduitInnerArea.toFixed(3) in²)</span> </div> `; fillDetailsDiv.innerHTML = ` <div class="fill-percent">📐 Calculated fill: $fillPercentActual.toFixed(1)% (max allowed $fillLimit*100%)</div> <div>⚡ Total conductor area: $totalWireArea.toFixed(4) in² 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';
<hr> <h3>📘 Conduit Fill Reference Table (for common wires)</h3> <div style="overflow-x:auto;"> <table> <thead> <tr><th>Wire Size (AWG/kcmil)</th><th>THHN/THWN Area (in²)</th><th>XHHW Area (in²)</th><th>Trade Size 3/4" EMT (40% fill max area)</th></tr> </thead> <tbody> <tr><td>14 AWG</td><td>0.0097</td><td>0.0123</td><td>0.213 in²</td></tr> <tr><td>12 AWG</td><td>0.0133</td><td>0.0160</td><td>0.213 in²</td></tr> <tr><td>10 AWG</td><td>0.0211</td><td>0.0243</td><td>0.213 in²</td></tr> <tr><td>8 AWG</td><td>0.0366</td><td>0.0410</td><td>0.213 in²</td></tr> <tr><td>6 AWG</td><td>0.0507</td><td>0.0590</td><td>0.346 in² (1" EMT)</td></tr> <tr><td>4 AWG</td><td>0.0824</td><td>0.0937</td><td>0.598 in² (1¼" EMT)</td></tr> </tbody> </table> <p class="note" style="margin-top:8px;">⚠️ Full NEC Chapter 9 Table 4 & 5 used in calculator logic for 1/2" to 4" conduit.</p> </div> </div> Determine minimum conduit size (EMT, PVC, Rigid) for
<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>