# Wire Size & Voltage Drop Calculator (NEC and IEC) (`jumblemog/wire-size-calculator`) Actor

Wire and cable sizing for electrical circuits: NEC ampacity (AWG, kcmil) or IEC 60364 (mm²) with derating, breaker, voltage drop, ground wire and fault current. Text or JSON in. For AI agents.

- **URL**: https://apify.com/jumblemog/wire-size-calculator.md
- **Developed by:** [Jumble Mog](https://apify.com/jumblemog) (community)
- **Categories:** AI, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Wire Size & Voltage Drop Calculator (NEC and IEC)

**Size the wire for any circuit from one line of text.** Type `30 A continuous, 240 V single phase, 150 ft, copper THHN` or `11 kW, 400 V three phase, 80 m, XLPE`. You get back:

- **The wire size**: the smallest conductor that carries the current, is protected by a standard breaker, and keeps the voltage drop within your limit (3% unless you say otherwise).
- **The voltage drop** in volts and percent, the voltage at the load, the losses, and the longest run that size allows.
- **The breaker** and the **grounding conductor**, upsized in proportion when the wire was upsized for voltage drop.
- **Which limit decided**: ampacity or voltage drop, and the sizes each one alone would need.
- **A chart** of voltage drop and ampacity for the sizes around the pick.

Two rule sets:

- **NEC** (US): AWG and kcmil, Table 310.16 at 60, 75 or 90 °C. It applies ambient and bundling factors, the terminal temperature limit, the small-conductor breaker limits and the next-size-up rule. Continuous loads are taken at 125%, and motors get their current from Tables 430.248 and 430.250.
- **IEC 60364-5-52** (UK, EU and most of the world): mm² for PVC or XLPE cable, in conduit (method B1) or clipped to a wall (method C). It applies ambient and grouping factors, and the breaker meets Ib ≤ In ≤ Iz.

It also:

- **Checks a size you name**: `check 4 AWG` tells you whether it works and why not.
- **Finds the fault current** at the load from the source's fault level or a transformer's kVA and impedance.
- **Turns loads into amps**: kW with power factor, kVA, or motor horsepower.

It's made for:

- Electricians, electrical engineers and contractors doing quick checks and takeoffs.
- Solar and EV-charger installers, and DC runs for RVs, boats and off-grid systems.
- Facility managers and students.
- AI agents that need a real wire size instead of a guess.

![A 30 A continuous circuit at 240 V over 150 ft sized by this Actor: 8 AWG copper on a 40 A breaker with a 2.51% voltage drop, shown against 12, 10, 6 and 4 AWG for voltage drop and ampacity](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/wire-size-calculator-example.png?signature=PbDSdSNMj2JhJBgBRX6)

### How to use it

1. Write **Circuits**, one per line, such as `40 A, 120 V, 200 ft, copper`. The form has examples.
2. Optionally set the **Code**, a **Default voltage**, a **Default conductor** or a **Default voltage-drop limit**.
3. Click **Start**. Each circuit is a row in the results, with its summary, chart and report.

#### Writing circuits

A line can hold any of these, in any order:

- **The load**: `30 A`, `10 kW`, `15 kVA`, `20 hp motor`, plus `continuous` and `pf 0.85`.
- **The supply**: `240 V`, `single phase`, `three phase` or `DC`.
- **The length**: one way, such as `150 ft` or `45 m`.
- **The conductor**:
  - The metal: `copper` or `aluminum`.
  - The insulation: `THHN`, `THWN`, `XHHW-2`, `TW`, `NM-B`, `UF`, `PVC` or `XLPE`.
  - Or a rating, such as `75 C rated`.
- **Conditions**:
  - `40 C ambient`.
  - Grouping: `6 current-carrying conductors` (NEC) or `3 circuits grouped` (IEC).
  - `method C`.
  - `2 parallel sets`.
- **Limits and checks**: `2% drop`, `check 4 AWG` or `check 6 mm2`, and a source fault level such as `65 kA`.

Objects work too, with the same fields named; see Input.

The code is picked from what you write: feet, AWG and 120/208/240/277/480 V mean the NEC; meters, mm² and 230/400 V mean IEC. You can also set it.

### Examples

All of these ran on this Actor; the numbers are from the results.

| Circuit | Result |
|---|---|
| `30 A continuous, 240 V single phase, 150 ft, copper THHN` | 8 AWG on a 40 A breaker (37.5 A design current; 10 AWG carries only 35 A at 75 °C), 2.51% drop |
| `40 A, 120 V, 200 ft, copper` | 3 AWG for voltage drop (8 AWG carries the current but drops 9.42%), 2.86% drop, 4 AWG ground wire upsized by 250.122(B) |
| `20 hp motor, 480 V three phase, 300 ft, copper THWN` | 27 A from Table 430.250, 10 AWG, 2.97% drop |
| `100 A, 480 V 3 phase, 500 ft, aluminum XHHW-2, 6 current-carrying conductors, 40 C ambient, check 4 AWG` | 3/0 AWG aluminum (128 A after 0.91 and 0.8 factors), 2.38% drop. The 4 AWG asked about fails on both counts |
| `11 kW, 400 V three phase, 80 m, XLPE, pf 0.85, 3 circuits grouped` | 18.7 A: 4 mm² (25.9 A after grouping) on a 20 A breaker, 2.86% drop |
| 200 A at 208 V three phase, 250 ft, copper THHN, from a 150 kVA 4% transformer | 250 kcmil for voltage drop, 2.71%. Fault current 10.4 kA at the transformer, 4.57 kA at the load |

The tests check that:

- Areas match ASTM B258.
- Resistance matches NEC Chapter 9 Table 8 (12 AWG: 1.98 Ω/kft at 75 °C).
- Correction factors match Table 310.15(B)(1) and IEC Table B.52.14.
- The 75 °C terminal rule, the 240.4(D) small-conductor limits and the next-size-up rule are applied.
- Voltage drop matches the hand formula, for AC and DC.
- Motor currents match the tables, and IEC sizes match the tables.

### How-to examples

Each example is a complete input; the results are from runs of the Actor (also listed under **Examples**).

#### How to find what size wire you need for a circuit (NEC)

```json
{"circuits": ["30 A continuous, 240 V single phase, 150 ft, copper THHN"]}
```

Result: 8 AWG on a 40 A breaker. The design current is 37.5 A, and 10 AWG carries only 35 A at 75 °C. The voltage drop is 2.51%.

#### How to calculate voltage drop on a long run

```json
{"circuits": ["40 A, 120 V, 200 ft, copper"]}
```

Result: 3 AWG for voltage drop, at 2.86%. 8 AWG carries the current but drops 9.42%. The ground wire is upsized to 4 AWG by NEC 250.122(B).

#### How to size a cable in mm² (IEC 60364)

```json
{"circuits": ["11 kW, 400 V three phase, 80 m, XLPE, pf 0.85, 3 circuits grouped"]}
```

Result: 18.7 A, so 4 mm² (25.9 A after grouping) on a 20 A breaker, with a 2.86% drop. Motors work from horsepower too: `20 hp motor, 480 V three phase, 300 ft, copper THWN` gives 27 A from Table 430.250 and 10 AWG.

#### How to let an AI agent size wires

Add this Actor to the [Apify MCP server](https://mcp.apify.com) with `https://mcp.apify.com/?tools=jumblemog/wire-size-calculator`. The agent passes the circuit as one line and answers with the size, the breaker and the voltage drop from the code tables, instead of a rule of thumb.

### FAQ

**Which codes does it follow?** The NEC (US) with Table 310.16, and IEC 60364-5-52 for mm² cables in the UK, EU and most of the world. The code is picked from the units you use, or set `code`.

**Does it apply derating?** Yes: ambient temperature and bundling or grouping factors, the 75 °C terminal rule, the small-conductor breaker limits and the next-size-up rule.

**Can it check a wire size I already have?** Yes. Add `check 4 AWG` and it says whether that size passes and why not.

**Does it do aluminum and DC?** Yes, copper or aluminum, AC single or three phase, and DC.

**Is it a substitute for an electrician?** No. It's a calculation to plan and check against; local codes and an inspector have the final word.

### Input

| Field | What it is |
|---|---|
| `circuits` | Circuits, as text lines or objects. |
| `code` | `auto`, `NEC` or `IEC`. |
| `voltage`, `material`, `maxVoltageDrop` | Defaults for circuits that don't give them. |
| `charts` | Draw charts (default on). |

**A circuit as an object** takes:

- **Load**: `current`, or `load` (`"10 kW"`, `"15 kVA"`, `"20 hp"`); `powerFactor`; `continuous`; `motor`.
- **Supply**: `voltage` and `phase` (`1`, `3` or `dc`).
- **Run**: `length` (one way); `parallelSets`; `reactance` (Ω/km or Ω/kft); `cable` (multicore, for a lower reactance).
- **Conductor**: `material`; `insulation` or `temperatureRating`; `terminalRating` (NEC, default 75 °C).
- **Conditions**: `method` (IEC: `B1` or `C`); `ambient`; `conductorsInRaceway` (NEC) or `circuitsGrouped` (IEC).
- **Limits and checks**: `maxVoltageDrop`; `size` (to check one).
- **Source**: `faultCurrent`, or `transformer` (`{"kVA": 150, "impedance": "4%"}`).
- **Other**: `code`, `title`, and `text` (a line to start from, which the other fields override).

### Output

One dataset item per circuit, also saved together in the run's `OUTPUT` record:

```json
{
  "request": 1, "status": "ok", "code": "NEC",
  "title": "8 AWG copper for 30 A at 240 V",
  "summary": "30 A continuous load at 240 V single phase over 150 ft: 8 AWG copper carries 50 A on a 40 A breaker, voltage drop 2.51% (6.01 V).",
  "circuit": {"voltage": 240, "system": "single phase", "loadCurrent": 30, "designCurrent": 37.5, "length": 150,
              "material": "Copper", "insulationRating": 90, "terminalRating": 75, "maxVoltageDropPercent": 3},
  "recommended": {"size": "8 AWG", "areaMm2": 8.366, "ampacity": 50, "breaker": 40, "voltageDrop": 6.01,
                  "voltageDropPercent": 2.51, "receivingVoltage": 233.99, "conductorTemperature": 51.6, "loss": 194.5},
  "limitedBy": "ampacity", "sizeForAmpacity": "8 AWG", "sizeForVoltageDrop": "8 AWG",
  "maxLengthAtRecommended": 179.6,
  "groundingConductor": {"size": "10 AWG", "rule": "NEC Table 250.122"},
  "sizes": [{"size": "14 AWG", "ampacity": 20, "breaker": 40, "meetsAmpacity": false, "voltageDropPercent": 13.72, "...": "..."}, "..."],
  "imageUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-....png"
}
```

`checked` has the size asked about, and `faultCurrent` has the fault current at the source and at the load, in amps. Lengths are in feet for the NEC and meters for IEC (see `unitLabels`). A circuit that can't be sized has `"status": "failed"` and the reason in `error`, and isn't billed.

### How it works

1. **Reading the circuit**: the line is split into its parts. Loads become amps:
   - kW use the power factor;
   - kVA use the voltage;
   - horsepower uses the NEC motor tables.
2. **Ampacity of each standard size**:
   - NEC: the table value at the insulation's temperature column, times the ambient factor and the bundling factor. The result is held to the terminal column.
   - IEC: the Annex B value for the method and the number of loaded conductors, times the ambient factor and the grouping factor.
3. **The breaker for each size**: the smallest standard rating at or above the design current, checked against the conductor's ampacity.
4. **Voltage drop for each size**:
   - The formula is k·I·L·(R cos φ + X sin φ), with k = 2 for single phase and DC and √3 for three phase.
   - R is taken at the conductor's estimated operating temperature, from its area and the metal's resistivity.
   - X defaults to 0.15 Ω/km for single conductors in a raceway and 0.08 Ω/km for multicore cable.
5. **The pick** is the smallest size that passes both checks.
6. **Charts** are drawn with Vega-Lite and rendered with vl-convert.

### Pricing

You pay one low price per circuit, at the price shown on this page. It includes the chart and the report. Circuits that can't be sized are never charged. If you set a maximum cost per run, the Actor stops before a circuit that wouldn't fit.

### Speed

Each circuit takes a few milliseconds plus its chart. A run through the API answers in about 5 to 10 seconds, including the cloud container starting.

### Tips and limits

- **Check your local code and the equipment's instructions.** This tool applies the main sizing rules; an inspector applies all of them.
- **Not included**: conduit fill; the NEC's own Table 9 impedances (resistance is computed from the metal instead, which matches Table 8 within about 2%); and the IEC methods other than B1 and C.
- **IEC aluminum** capacities are taken as 78% of copper's, typical of the IEC tables. IEC aluminum sizes start at 16 mm².
- **Motors**: conductors are sized at 125% of the table current. Size the short-circuit protection by NEC 430.52 and the overload protection from the nameplate.
- **Fault current**: a bolted fault with the conductors at 20 °C. The source X/R is taken as 4.
- **Limits**: 500 circuits per run, 1 to 20 parallel sets.

### For AI agents and developers

This Actor works with the [Apify MCP server](https://mcp.apify.com), so AI agents can call it as a tool. Pass `circuits` as plain text and read `summary`, `recommended.size`, `recommended.breaker` and `recommended.voltageDropPercent`. A direct API call that waits for the answer:

```bash
curl -X POST "https://api.apify.com/v2/acts/jumblemog~wire-size-calculator/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"circuits": ["48 A continuous EV charger, 240 V single phase, 90 ft, copper THHN"]}'
```

`run-sync` instead returns the run's `OUTPUT`: the status, the counts and every result as JSON.

In Python, with the `apify-client` package:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("jumblemog/wire-size-calculator").call(run_input={
    "circuits": [{"load": "7.4 kW", "voltage": "230 V", "phase": 1, "length": "35 m", "insulation": "PVC",
                  "method": "C", "maxVoltageDrop": "5%"}],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["summary"])
```

### Credits

- Charts: [Vega-Lite](https://vega.github.io/vega-lite/) and [vl-convert](https://github.com/vega/vl-convert) (BSD-3-Clause), with the [Inter](https://rsms.me/inter/) font (SIL Open Font License).
- Rules and tables:
  - NFPA 70, *National Electrical Code*: Tables 310.16, 310.15(B)(1) and (C)(1), 240.4(D), 240.6(A), 250.122, 430.248 and 430.250, and Chapter 9 Table 8.
  - IEC 60364-5-52, *Selection and erection of electrical equipment: Wiring systems*, Annex B.
  - IEC 60364-5-54, Table 54.2.
  - ASTM B258, *Standard Specification for Standard Nominal Diameters and Cross-Sectional Areas of AWG Sizes*.

# Actor input Schema

## `circuits` (type: `array`):

One circuit per entry, as a line of text or an object. Text: '30 A continuous, 240 V single phase, 150 ft, copper THHN', '20 hp motor, 480 V three phase, 300 ft', '11 kW, 400 V three phase, 80 m, XLPE, method C'. Object fields: current (or load: '10 kW', '15 kVA', '20 hp'), voltage, phase (1, 3 or dc), powerFactor, length (one way), material (copper or aluminum), insulation (THHN, THWN, XHHW-2, TW, NM-B, UF, PVC, XLPE) or temperatureRating, terminalRating (NEC, default 75 °C), method (IEC: B1 in conduit, C clipped), ambient, conductorsInRaceway (NEC) or circuitsGrouped (IEC), continuous, motor, maxVoltageDrop (default 3%), parallelSets, size (to check one), reactance, cable (multicore), faultCurrent at the source or transformer {kVA, impedance}, code (NEC or IEC), title.

## `code` (type: `string`):

Which rules and sizes to use. Automatic picks the NEC for feet, AWG and 120/208/240/277/480 V, and IEC for meters, mm² and 230/400 V.

## `voltage` (type: `string`):

For circuits that don't give one, such as 240 V or 400 V.

## `material` (type: `string`):

For circuits that don't say. Empty: copper.

## `maxVoltageDrop` (type: `string`):

For circuits that don't give one, such as 3% or 5%. Empty: 3%.

## `charts` (type: `boolean`):

Voltage drop and ampacity by size for each circuit.

## Actor input object example

```json
{
  "circuits": [
    "30 A continuous, 240 V single phase, 150 ft, copper THHN",
    "20 hp motor, 480 V three phase, 300 ft, copper THWN",
    "100 A, 480 V 3 phase, 500 ft, aluminum XHHW-2, 6 current-carrying conductors, 40 C ambient, check 4 AWG",
    "11 kW, 400 V three phase, 80 m, XLPE, pf 0.85, 3 circuits grouped",
    {
      "title": "Panel feeder",
      "current": "200 A",
      "voltage": "208 V",
      "phase": 3,
      "length": "250 ft",
      "material": "copper",
      "insulation": "THHN",
      "transformer": {
        "kVA": 150,
        "impedance": "4%"
      }
    }
  ],
  "code": "auto",
  "charts": true
}
```

# Actor output Schema

## `results` (type: `string`):

One row per circuit: the summary and chart.

## `output` (type: `string`):

The OUTPUT record: every result in one JSON object.

## `files` (type: `string`):

Charts (PNG and SVG) and Markdown reports in the run's key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "circuits": [
        "30 A continuous, 240 V single phase, 150 ft, copper THHN",
        "20 hp motor, 480 V three phase, 300 ft, copper THWN",
        "100 A, 480 V 3 phase, 500 ft, aluminum XHHW-2, 6 current-carrying conductors, 40 C ambient, check 4 AWG",
        "11 kW, 400 V three phase, 80 m, XLPE, pf 0.85, 3 circuits grouped",
        {
            "title": "Panel feeder",
            "current": "200 A",
            "voltage": "208 V",
            "phase": 3,
            "length": "250 ft",
            "material": "copper",
            "insulation": "THHN",
            "transformer": {
                "kVA": 150,
                "impedance": "4%"
            }
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jumblemog/wire-size-calculator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "circuits": [
        "30 A continuous, 240 V single phase, 150 ft, copper THHN",
        "20 hp motor, 480 V three phase, 300 ft, copper THWN",
        "100 A, 480 V 3 phase, 500 ft, aluminum XHHW-2, 6 current-carrying conductors, 40 C ambient, check 4 AWG",
        "11 kW, 400 V three phase, 80 m, XLPE, pf 0.85, 3 circuits grouped",
        {
            "title": "Panel feeder",
            "current": "200 A",
            "voltage": "208 V",
            "phase": 3,
            "length": "250 ft",
            "material": "copper",
            "insulation": "THHN",
            "transformer": {
                "kVA": 150,
                "impedance": "4%",
            },
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("jumblemog/wire-size-calculator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "circuits": [
    "30 A continuous, 240 V single phase, 150 ft, copper THHN",
    "20 hp motor, 480 V three phase, 300 ft, copper THWN",
    "100 A, 480 V 3 phase, 500 ft, aluminum XHHW-2, 6 current-carrying conductors, 40 C ambient, check 4 AWG",
    "11 kW, 400 V three phase, 80 m, XLPE, pf 0.85, 3 circuits grouped",
    {
      "title": "Panel feeder",
      "current": "200 A",
      "voltage": "208 V",
      "phase": 3,
      "length": "250 ft",
      "material": "copper",
      "insulation": "THHN",
      "transformer": {
        "kVA": 150,
        "impedance": "4%"
      }
    }
  ]
}' |
apify call jumblemog/wire-size-calculator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jumblemog/wire-size-calculator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/kf8HBOQpdF8ysiked/builds/kPMhdeQwNfQFBEc6J/openapi.json
