Ever dreamed of powering your backyard workshop or home office in the shed? You’re not alone. Many homeowners wonder how to run electricity to a shed safely and affordably. The good news: with some planning and basic DIY skills, you can light up your shed with a dedicated circuit from your home or even alternative sources like a generator or solar panels. Think of it as an upgrade that literally sparks new possibilities—workbench lamps, electric tools, or even heating. Before you jump in, safety and code compliance must come first. This guide will take you step-by-step through exactly how to run electricity to a shed safely and in line with building codes, so you can tackle this project confidently, just like a pro.
Planning and Permits
If you’re a DIYer wondering how to run electricity to a shed, careful planning is the first step. Decide what you’ll power (lights, outlets, tools, maybe an electric heater) and calculate the load. For example, a workshop with heavy machinery might need a large 240V circuit or a small subpanel, whereas a potting shed might get by with a simple 120V outlet【hartvilleoutdoorproducts.com】. Check your local building codes and pull any required electrical permits. These rules often follow the NEC, which even limits a shed to one supply feeder【deperewi.gov】. Permits ensure the work is inspected (meeting NEC and local codes) and that it’s safe. In other words, investing time in planning and permits now pays off in peace of mind and ensures any insurance covers the work.
Gather Tools and Materials

Even experienced DIYers should remember that knowing how to run electricity to a shed safely follows several key steps, including gathering the right tools. You’ll need:
- Hand tools: Insulated screwdrivers, pliers, wire cutters, etc.
- Power tools: A drill and hole saw (to cut panel knockouts), and a jigsaw.
- Trenching tools: A trenching shovel or powered trencher for digging.
- Conduit and cable: PVC conduit and THHN/THWN wire, or direct-burial UF-B cable (rated for outdoor use).
- Safety gear: Gloves, eye protection, and a voltage tester.
- Breaker and panel: A proper breaker for your circuit (for example, a 20A breaker with 12-gauge copper)【deperewi.gov】.
Having these in hand lets you focus on the steps, not running to the store mid-project. (Pro tip: double-check you have GFCI-capable breakers or GFCI outlets for any exterior receptacles【deperewi.gov】.)
Choose Your Power Source
Before deciding on wiring, think about how to run electricity to a shed from your power source. How will you actually feed power into the shed? Here are the common options:
From the Home Electrical Panel
The usual approach is to run a dedicated circuit from your house panel to the shed. This means installing a new breaker (say 15A or 20A on a 12- or 10-gauge wire for basic outlets) and pulling cable out to the shed. If you have heavy loads (like welders or a mini-split A/C) you might use a 240V feed or even a small subpanel in the shed【hartvilleoutdoorproducts.com】. In any case, NEC 225.30 allows only one feeder to a detached building【deperewi.gov】, so plan accordingly. You’ll route the wire through a trench or conduit (see next section) from the house to the shed wall.
Portable or Standby Generator
If you’d rather not trench, you can power the shed with a portable generator. Install a weatherproof generator inlet on the shed wall. Then connect your generator to that inlet with a heavy-duty cord (often 30A or 50A). This setup requires a transfer switch or interlock to isolate the shed circuit from the grid (so you don’t backfeed the utility). For small generators, a 120V branch circuit is common; for larger standby units, a 240V inlet is used. Either way, follow the manufacturer’s instructions and local codes for transfer switches and outdoor inlets.
Solar Panels

Fancy going off-grid? You can outfit your shed with solar panels, batteries, and an inverter. A rooftop array feeding a battery/inverter system can power lights, tools, or a few appliances. Always label solar equipment according to code, and note that solar alone might not run heavy machinery. Solar power is a great off-grid option, but typically only if your shed is remote or in full sun (otherwise a partial system for lights and charging electronics).
No matter which source you choose, safety is non-negotiable. Always shut off power before working and use a voltage tester to confirm wires are dead. Keep conduits and connections watertight, and follow the NEC for clearances, box fill, and protective devices.
Dig and Trench (Underground Wiring)

The most common method is underground wiring, which means burying cable or conduit in a trench. Here’s the drill:
- Call 811: Before any digging, call your utility location service (in the U.S.) to mark buried lines.
- Mark the Route: Spray-paint or stake out a direct trench line from the house to the shed.
- Dig the Trench: Dig a trench about 6–12 inches wide, sloping slightly toward the shed if rain can pool.
- Bury Depth: The NEC requires at least 18 inches of cover for conduit and 24 inches for direct-burial cable【deperewi.gov】. (Some sources note a 12″ depth if the circuit is GFCI-protected【hartvilleoutdoorproducts.com】, but playing it safe at 18–24″ is best, especially in cold climates.)
- Install Conduit (if used): If you’re using PVC conduit (very common for protection), cut it to length and glue it together along the trench. Run the conduit from the house (entering a concrete basement or slab) to a junction box near ground level on the shed, then from that box up the shed wall.
- Lay the Cable: For conduit wiring, fish THHN/THWN wires (one hot, one neutral, one ground for 120V; add a second hot for 240V) through the conduit. For direct-burial you can lay UF-B cable directly in the trench (no conduit needed). Use UV-rated staples or clamps to secure cable in boxes. Ensure all connectors in/out of boxes have proper bushings.
- Backfill Carefully: Cover the cable with 3–4 inches of fine soil or sand first (to protect it from rocks), then fill the trench. Many pros leave a plastic warning tape a foot above the conduit/cable.
If you need to cross a driveway or road, switch to rigid metal conduit for that short span (you only need 6 inches cover if using metal conduit)【deperewi.gov】. Keep conduits and junction boxes 18″ above grade unless listed for burial.
Overhead Wiring (Alternative)
If you’d prefer not to dig, you might ask how to run electricity to a shed overhead. This involves installing a weatherhead on the shed and running insulated cable from an existing structure or pole. Overhead wires must meet clearance rules (roughly 12–18 feet off the ground for 120/240V) and be rated for outdoor use. Usually a professional handles this, since it often involves utility service work. For DIY, the main concerns are installing a proper mast, drip loop, and breaker/interlock so the shed’s wiring never connects to the house feed and utility at the same time. Because of the complexity, most homeowners find underground wiring simpler and safer.
Connect to the House Panel
With cable at the shed, the final step of how to run electricity to a shed is tying it into your house wiring:
- At the House Panel: Turn off the main breaker. Install a new breaker matching your circuit (e.g. 20A for 12-gauge). Connect the shed’s hot wire to that breaker, the neutral to the panel’s neutral bus, and the ground to the ground bus. (Ensure neutrals and grounds are not tied together on any subpanel feeders – they must stay separate【deperewi.gov】.)
- Breaker Sizing: Match the breaker to the wire size (e.g. 15A breaker for 14-gauge, 20A for 12-gauge). Label the breaker as “Shed” or similar. If using a 240V shed panel, you’ll use a two-pole breaker and a 4-conductor cable (hot, hot, neutral, ground)【deperewi.gov】.
- GFCI & Disconnect: Code often requires a GFCI-protected disconnect for a detached building’s circuit【deperewi.gov】. You can meet this with a GFCI breaker or a GFCI outlet at the shed. If you installed a subpanel in the shed, don’t forget a grounding electrode (ground rod) at the shed, and bond the panel’s ground bar to it.
- Test Before Finalizing: After wiring, turn on the main breaker and then the shed breaker. Use a voltmeter at the shed end to check ~120V (or ~240V) between the conductors. Test any GFCI outlets to ensure protection works.
Complete the Shed Wiring
Inside the shed, install outlets, switches, and lights as planned. Use outdoor-rated boxes and covers if needed. Staple or route cable neatly along studs (or use conduit inside). A typical setup: one switch and light at the door, plus multiple receptacles (GFCI-protected) around the walls. If you ran a 240V feeder for power tools, install the appropriate receptacle or subpanel in the shed. Remember safety: box all splices, use wire connectors, and keep the panel accessible. Finally, check all circuits with a lamp or tester. If you pulled a permit, schedule the inspection – fix any issues (like missing labels or open grounds) that the inspector notes before closing up walls.
Conclusion
Now you have the knowledge of how to run electricity to a shed and can safely complete your DIY project. By following each step—from planning and permits, to running the cable, to final wiring and testing—you’ll add lights, outlets, and convenience to your shed. In the end, you’ll turn that empty outbuilding into a fully functional workspace or hangout. Always err on the side of caution: if you’re unsure about any part of the electrical work, consult a qualified electrician. With care and the right preparation, your backyard shed will be powered up in no time!
FAQs
- What should I do first? Before any digging or wiring, plan your route and get the necessary permits. These early steps are vital to understanding how to run electricity to a shed safely and legally.
- Do I need a permit to wire a shed? Almost certainly. Most local codes require electrical permits for a new circuit to a detached building. Pulling a permit ensures the work is inspected. It may cost a bit (often $50–$100), but it also avoids trouble with insurance or selling the house later.
- Can I use an extension cord instead of wiring? No. Extension cords are only for temporary use and are not a substitute for permanent wiring【deperewi.gov】. They can overheat or be damaged outdoors. Always install proper wiring or use a transfer switch and inlet for a generator – don’t rely on an extension cord for a long-term power feed.
- How deep should I bury the cable? As a rule of thumb, bury conduit at least 18 inches deep and direct-burial cable at 24 inches【deperewi.gov】. Some sources say you can do 12 inches if the circuit is GFCI-protected, but it’s safest to follow the full depths. Always check your local code (some areas require deeper trenches below frost lines).
- Should I use conduit or UF-B cable? Both work. Conduit with THHN is very durable and lets you pull new wires later; PVC conduit is cheap and long-lasting【hartvilleoutdoorproducts.com】. UF-B cable is simpler: it’s a flat, direct-burial cable you just lay in the trench. UF-B can handle moisture but can be hard to splice later. If your trench is rocky or you want extra protection, use conduit. For a quick run, UF-B is fine.
- What wire gauge do I need? It depends on your load. For a standard 120V, 15A circuit, use 14-gauge copper wire. For 20A (most shed outlets/circuits), use 12-gauge. If you add a 30A circuit (e.g. for a welder or subpanel), use 10-gauge. In general, match the breaker to the wire: 20A breaker with 12-gauge, 30A with 10-gauge【deperewi.gov】.
Following these guidelines will get electricity safely to your shed. Take your time, double-check connections, and enjoy the convenience and fun your newly powered shed will bring!