Understanding the National Electrical Code (NEC) requirements for junction boxes in homes can be confusing for the layman or even an experienced do-it-yourselfer. The primary reason is that the NEC doesn't refer to the sizes of junction boxes within its text. The NEC refers instead to the space required within a junction box or the box volume in cubic inches (CI).
Each power-conducting wire, called “conductors” by the NEC, inside of a junction box requires a set amount of space (volume) in the box. The exact amount of required space, in cubic inches (CI), is determined by the gauge size of the individual wires: 6-gauge wires require 5 CI; 8-gauge requires 3 CI; 10-gauge requires 2.5 CI; 12-gauge requires 2.25 CI; and 14-gauge requires 2.0 CI. A space allotment of 2.25 CI must be included for any clamps in the box that secure the wiring.
Though ground wires are technically conductors, the NEC makes a special consideration for them in junction boxes. A junction box is required by the NEC to have a single 2.25 CI space allotted for all ground wires in the box. In steel boxes, this allotment also includes the NEC-required ground wire connecting the steel box to all other ground wires in the box.
NEC requirements can vary from box to box, depending on the wiring you use. There are also general NEC requirements that apply to all junction boxes in homes. All unused openings on a junction box must be closed and the box must have a cover installed; all junction boxes must be readily accessible and can't be hidden inside of walls, ceilings and floors; any connection, splice or joining of wires in a home must take place inside a junction box; and wires entering or leaving nonmetallic junction boxes that lack wire clamps must be secured outside of the box, within 8 inches of the box.