How To Wire A Shed For Electricity: A Code-Compliant Step-by-Step Guide
Wiring a backyard shed requires running a dedicated electrical feed from your home's main service panel to either a subpanel or a single GFCI-protected branch circuit inside the structure. To comply with National Electrical Code (NEC) regulations, you must excavate trenches to depths of 12 to 24 inches depending on the conduit method and use appropriately sized UF-B direct-burial cable or THWN-2 conductors. Establishing a secondary grounding system and isolating neutral and ground paths at the shed subpanel are mandatory benchmarks for a safe, fully operational electrical installation.
Shed Electrification Planning, Permits, and Tool Checklist
Before commencing any physical labor, you must consult your local building department to obtain the necessary electrical and building permits. All electrical installations in the United States must conform to the National Electrical Code (NEC), alongside any local municipal amendments. Operating without a permit can void homeowner's insurance policies, complicate future property sales, and introduce severe safety hazards.
The scope of this project ranges from a simple 120-volt, 20-amp single branch circuit (ideal for basic lighting and a few receptacles) to a robust 120/240-volt, 30-to-50-amp subpanel installation (designed for heavy woodworking tools, space heaters, or air conditioning units).
Essential Tools and Materials
- Safety Equipment: Leather work gloves, safety glasses, and non-conductive fiberglass ladders.
- Hand Tools: Wire strippers (10-18 AWG capacity), linemans pliers, needle-nose pliers, utility knife, screwdrivers (flathead and Phillips), and a drywall saw.
- Specialty Electrical Tools: Non-contact voltage tester, digital multimeter, fish tape (50–100 feet), and a conduit bender.
- Excavation Gear: Trenching shovel, mattock, and layout string.
- Conduit and Fittings: Schedule 40 PVC conduit (for underground runs), Schedule 80 PVC conduit (for exposed above-ground runs subject to physical damage), PVC cement, and LB conduit bodies.
- Wire and Cable: THWN-2 individual copper conductors (for conduit runs) or UF-B underground feeder cable (for direct burial).
- Electrical Enclosures: Main panel breaker (sized to match your feeder), an outdoor-rated subpanel (NEMA 3R) or indoor-rated subpanel (NEMA 1) for the shed, 8-foot copper-clad grounding rods, and ground clamps.
Prerequisite Knowledge & Code Standards
- NEC Article 300: Governs general wiring methods and materials, specifically Table 300.5 for minimum cover requirements.
- NEC Article 250: Details grounding and bonding requirements. If you run a subpanel to a detached structure, you must install a grounding electrode system (ground rods) and keep the neutral and ground buses completely isolated.
- Ampacity and Voltage Drop Calculations: For wire runs exceeding 100 feet, you must upsize the conductor gauge to mitigate voltage drop, aiming for less than a 3% drop under full load.
Estimated Budget and Project Duration
- Estimated Budget: $350 to $1,200, highly dependent on the distance from the home, the choice of conduit versus direct-burial cable, and subpanel capacity.
- Project Duration: 12 to 20 hours of active labor, typically spread over a two-day weekend.
Execution Blueprint: Step-by-Step Guide to Wiring Your Shed
Follow these steps in sequential order to ensure a safe, efficient, and code-compliant electrical installation.
Step 1: Calculate Load Requirements and Choose Cable Run Type
Before purchasing wire, you must calculate the total electrical load of the shed. Sum the wattage of all planned lighting, power tools, and appliances. Divide this total wattage by 120 volts (or 240 volts for heavy machinery) to find the required amperage.
- Single Branch Circuit (120V, 15A or 20A): If you only need to power a light fixture and a couple of outlets for low-draw devices, a single multi-wire branch circuit is sufficient. This setup does not require a subpanel or a dedicated grounding rod at the shed.
- Feeder Subpanel (120/240V, 30A to 50A): If your shed will function as a workshop with a table saw, compressor, or heating/cooling units, you must run a four-wire feeder (two hot wires, one neutral, and one ground) to an independent subpanel inside the shed.
Warning: Never attempt to tap into an existing household branch circuit (such as an outdoor patio outlet) to feed a subpanel. A subpanel must always be fed directly from a dedicated breaker inside your main household service panel.
Step 2: Dig the Trench
The depth of your trench is dictated by the wiring method you select under NEC Table 300.5.
- Plot the trench line using stakes and string. Ensure you avoid buried utility lines by calling 811 (diggers hotline) at least three business days before excavating.
- Dig the trench to the appropriate depth based on your selected materials:
- 24 Inches: Minimum cover required for direct-burial UF-B cable.
- 18 Inches: Minimum cover required for Schedule 40 PVC conduit containing individual THWN-2 conductors.
- 6 Inches: Minimum cover required for Intermediate Metal Conduit (IMC) or Rigid Metal Conduit (RMC).
- Smooth the bottom of the trench, removing any sharp rocks or debris that could puncture the cable or crush the conduit over time.
Step 3: Run the Conduit and Pull Conductors
Running individual THWN-2 conductors inside Schedule 40 and Schedule 80 PVC conduit provides the highest level of physical protection against moisture, rodents, and accidental shovel strikes.
- Assemble the PVC conduit runs along the trench. Clean the ends of the conduit and apply PVC primer and cement to fuse the sections together securely.
- Install Schedule 80 PVC conduit vertically where the run exits the ground and transitions up the exterior walls of both the house and the shed. Schedule 40 is not approved for areas exposed to physical damage.
- Install an LB conduit body at each exit point to transition the wiring horizontally through the exterior walls. Seal the entry holes through the house and shed walls with exterior-grade silicone caulk to prevent water and pest intrusion.
- Insert a fiberglass fish tape through the conduit run. Secure the ends of your THWN-2 conductors (or UF-B cable) to the fish tape loop and pull the wires through the conduit. Use wire-pulling lubricant to reduce friction on long runs or runs with multiple 90-degree bends.
Pro-Tip: Limit the number of 90-degree bends in your conduit run to a maximum of 360 degrees (four 90-degree turns) between pull points. Exceeding this makes pulling the wire physically difficult and risks stripping the insulation.
Step 4: Install the Grounding Rods (Subpanel Installations Only)
If you are installing a subpanel in a detached building, the NEC requires a dedicated grounding electrode system.
- Drive an 8-foot copper-clad grounding rod into the earth near the shed's exterior wall. Leave approximately 2 to 3 inches of the rod exposed above the ground level, or bury it completely in a handhole enclosure.
- If you encounter solid rock, you may drive the rod at an angle up to 45 degrees from vertical, or bury it horizontally in a trench at least 30 inches deep.
- Run a bare 6 AWG copper grounding electrode conductor from the grounding bar of the shed subpanel to the grounding rod. Secure it using an approved direct-burial ground clamp (commonly referred to as an "acorn" clamp).
Step 5: Mount and Wire the Shed Subpanel
Mount the subpanel inside the shed in a highly accessible location, ensuring there is at least 36 inches of clear working space in front of the panel face.
- Keep the neutral bus bar completely isolated from the grounding bus bar inside the subpanel. Remove the green bonding screw or strap that comes pre-installed in the panel. In a subpanel, the neutral and ground must only connect back at the main house service panel to prevent objectionable current from traveling over grounding paths.
- Terminate the two hot feeder conductors (usually black and red) into the main lugs of the subpanel.
- Terminate the white neutral feeder wire into the isolated neutral bus bar.
- Terminate the green or bare grounding conductor into the grounded bus bar. Connect the 6 AWG wire from your external ground rod to this same grounding bus bar.
Step 6: Rough-In Switches, Outlets, and Fixtures
With the subpanel in place, you can now distribute power throughout the interior of the shed.
- Mount plastic or metal junction boxes to the wall studs for outlets, switches, and overhead lighting.
- Run 12-2 NM-B (Romex) cable inside the interior walls of the shed to feed your branch circuits. Secure the cable to the studs using code-approved cable staples placed within 12 inches of each junction box and every 4.5 feet thereafter.
- Wire your receptacles. The first receptacle in each branch circuit must be a Ground Fault Circuit Interrupter (GFCI) outlet to protect the entire circuit from ground faults, which is a strict requirement for wet or damp locations like sheds.
- Connect the hot (black) wire to the brass terminals, the neutral (white) wire to the silver terminals, and the bare copper wire to the green grounding screw on all devices.
Step 7: Complete Main Panel Connections
Only proceed with the final connection at the main house service panel once all wiring inside the shed is fully assembled, enclosed, and inspected.
Warning: Working inside a live service panel carries a risk of electrocution. Always shut off the main main-breaker to de-energize the panel buses before removing the deadfront cover. If you are uncomfortable working inside a live panel, hire a licensed electrician for this step.
- Turn off the main breaker to the house. Verify the panel is de-energized using a reliable non-contact voltage tester or multimeter.
- Install a new, dedicated double-pole breaker (rated for 30A or 50A, matching your feeder wire capacity) into the main panel.
- Pull the feeder cable from the shed into the main panel using an approved cable clamp.
- Connect the black and red hot conductors to the new double-pole breaker terminals.
- Connect the white neutral conductor to the main neutral bus bar.
- Connect the green or bare grounding conductor to the main grounding bus bar.
- Replace the main panel deadfront cover, restore main power, and switch on your new feeder breaker. Test all outlets in the shed with a receptacle tester to confirm correct polarity and GFCI operation.
How to Run Electricity to a Shed - Genius Underground Wire Tricks ...
Underground Conduit Depth, Conduit Sizing, and Wire Gauge Reference Specs
The following table outlines the minimum depth requirements, wire gauges, and maximum amperage capacities for copper conductors running over standard distances to a residential shed.
| Wiring Method / Cable Type | Minimum Burial Depth | Maximum Allowable Amps (Copper) | Conductor Size for Runs < 100 Ft | Conductor Size for Runs > 100 Ft (Voltage Drop Adjusted) | PVC Conduit Diameter Required |
|---|---|---|---|---|---|
| UF-B Direct Burial Cable | 24 Inches | 20 Amps (120V) | 12 AWG | 10 AWG | N/A (Direct Burial) |
| THWN-2 in Sch. 40 PVC | 18 Inches | 30 Amps (120/240V) | 10 AWG | 8 AWG | 3/4 Inch |
| THWN-2 in Sch. 40 PVC | 18 Inches | 50 Amps (120/240V) | 8 AWG | 6 AWG | 1 Inch |
| THWN-2 in Rigid Metal (RMC) | 6 Inches | 50 Amps (120/240V) | 8 AWG | 6 AWG | 1 Inch |
Common Shed Electrical Failures and Field Remedies
When installing or testing your newly wired shed, you may encounter system faults or physical installation issues. Use these diagnosed failure scenarios to identify and fix the problems.
- Scenario 1: The GFCI breaker or receptacle in the shed trips immediately upon powering up or when a load is applied.
- Root Cause: A neutral-to-ground bond exists inside the subpanel or within an individual junction box, causing returning neutral current to split across both the neutral and ground paths.
- Actionable Fix: Remove the green bonding jumper screw from the subpanel to completely isolate the neutral bar from the metal panel enclosure. Use a multimeter to verify there is infinite resistance (no continuity) between the neutral bar and the ground bar when all feeder wires are disconnected.
- Scenario 2: Heavy motorized tools (like table saws or compressors) struggle to start or cause interior lights to dim significantly.
- Root Cause: Excessive voltage drop caused by undersized conductors over a long run distance, or loose terminal connections at the breaker or subpanel lugs.
- Actionable Fix: Measure the voltage at the subpanel under load using a digital multimeter. If the reading drops below 114V (on a 120V line), you must replace the feeder wire with a larger gauge (e.g., upgrading from 10 AWG to 8 AWG) or tighten all terminals to their specified torque ratings using a torque screwdriver.
- Scenario 3: The PVC conduit cracks or detaches from the exterior wall of the house during winter.
- Root Cause: Earth settling or seasonal frost heaving pulling down on the buried conduit, which lacked expansion joints.
- Actionable Fix: Cut out the damaged section of conduit above the ground line and install an inline PVC expansion joint fitting. This slip-joint design allows the buried portion of the conduit to move vertically with shifting soils without putting physical stress on the electrical boxes or wall connections.
Frequently Asked Questions
Can I run a single 15-amp or 20-amp circuit to my shed instead of a subpanel?
Yes, if your electrical needs are limited to basic overhead LED lighting and a few minor tools, you can run a single 120-volt branch circuit using 12 AWG wire. This setup does not require a subpanel or an auxiliary grounding rod, provided it is protected by a GFCI breaker or receptacle at the source.
Do I need to install a separate ground rod for a shed subpanel?
Yes, according to NEC Article 250, any detached structure supplied by a feeder circuit (which feeds a subpanel) must have an independent grounding electrode system. You must drive a minimum of one (and often two, spaced at least 6 feet apart) copper-clad grounding rod into the earth and connect it to your subpanel's grounding bus bar.
Can I run Romex (NM-B) wire inside underground conduit?
No, standard Romex (NM-B) wire is strictly rated for dry, indoor locations. Underground conduits are classified by the NEC as wet locations because water routinely condenses inside them. You must pull individual wet-rated conductors, such as THWN-2, or run direct-burial UF-B cable inside the conduit.
How deep do I need to dig the trench for my shed's electrical line?
The trench depth depends entirely on the wiring method you choose. Direct-buried UF-B cable must be at least 24 inches deep. If you run THWN-2 conductors inside Schedule 40 PVC conduit, the trench must be at least 18 inches deep, while rigid metal conduit (RMC) only requires a depth of 6 inches.
Power Up Your Backyard Workshop Safely
Running a dedicated electrical line to your shed unlocks its full potential as a workspace, studio, or utility center. Always prioritize safety by pulling permits, adhering strictly to current NEC regulations, and consulting a licensed electrician to handle or inspect the final panel connections.