Outlet Spacing Calculator Formula

Understand the math behind the outlet spacing calculator. Each variable explained with a worked example.

Formulas Used

Outlets Needed

outlets_needed = max_spacing > 0 ? ceil(wall_length / max_spacing) + num_doors : 0

Actual Spacing

actual_spacing = max_spacing > 0 && (ceil(wall_length / max_spacing) + num_doors) > 0 ? wall_length / (ceil(wall_length / max_spacing) + num_doors) : 0

Variables

VariableDescriptionDefault
wall_lengthTotal Wall Length(ft)40
max_spacingMax Spacing(ft)12
num_doorsNumber of Doorways2

How It Works

NEC Outlet Spacing (210.52)

The NEC requires that no point along a wall be more than 6 feet from an outlet. This effectively means outlets every 12 feet along unbroken walls. Each wall section separated by a door counts independently. Kitchens and bathrooms have additional requirements.

Worked Example

40 ft of total wall length with 2 doorways, 12 ft max spacing.

wall_length = 40max_spacing = 12num_doors = 2
  1. 01Base outlets = ceil(40 / 12) = 4
  2. 02Add 1 per doorway = 4 + 2 = 6 outlets
  3. 03Actual spacing = 40 / 6 = 6.7 ft apart

Frequently Asked Questions

What is the 6/12 rule?

No point along a wall can be more than 6 feet from an outlet. Since two outlets can serve a 12-foot span (6 ft to the left, 6 ft to the right), the practical spacing is every 12 feet.

Do kitchen outlets follow the same rule?

No. Kitchen countertop outlets must be spaced every 4 feet (NEC 210.52C) and each must be on a 20A small-appliance branch circuit.

Ready to run the numbers?

Open Outlet Spacing Calculator