How to Install an Electrical Junction Box
Installing an electrical junction box gives you freedom and flexibility when installing electrical cables. It's often used when an electrical circuit branches off in two or more directions. It's also a simple, approved solution for extending an electrical circuit since the National Electrical Code (NEC) dictates that no wiring splices are allowed outside an approved enclosure.
Learn how to install an electrical junction box, why you might need one, and how to safely install it.

Choose the Right Junction Box
Install an electrical junction box that is appropriate for the installation.
- Interior vs. exterior : Outdoor locations require a weatherproof junction box with gaskets to prevent moisture intrusion. Interior junction boxes in dry locations do not need to be waterproof.
- Correct fill capacity : The junction box should be large enough to contain the wires. Many DIYers choose the largest box practical for the application. To stay within code-approved limits, though, consult a fill capacity chart.
- Plastic vs. metal boxes : Use a metal junction box with metal-sheathed cable (also called BX cable), for proper grounding. Plastic junction boxes are used primarily with plastic-sheathed cable (also called NM, or non-metallic, cable).
Before You Begin
Turn off the power to the circuit you'll be working on by switching off the appropriate circuit breaker in your home's service panel (circuit breaker box). Test all of the wires you'll be working on with a non-contact voltage tester. The test should confirm that no voltage is present in any of the wires.
Source: https://www.thespruce.com/how-to-install-junction-boxes-1152327