NEC 314.16 sets how much wire, how many devices and how many clamps a box may hold, by volume. Every conductor gets a volume allowance by its size (Table 314.16(B)); add them up and compare with the box’s marked volume or its Table 314.16(A) figure.
What counts
Each conductor that enters and is spliced or terminated counts once; one that passes through unbroken counts once (314.16(B)(1)). Allowances: 14 AWG 2 in³, 12 AWG 2.25 in³, 10 AWG 2.5 in³.
All internal cable clamps together: one allowance for the largest conductor. Each device yoke (switch, receptacle): two, by the largest conductor connected to it. Up to four equipment grounding conductors: one; each additional one: a quarter (the 2020 change).
required in³ = Σ conductors × allowance + clamps (1) + fittings (1 each) + devices (2 each) + grounds (1 + ¼ per extra over 4)
Pigtails and fixture wires
A conductor that starts and ends inside the box (a pigtail) is not counted. Up to four fixture wires smaller than 14 AWG from a luminaire canopy into the box are not counted either.
Worked examples
A switch box fed by two 14/2 cables with a 14/3 to the next outlet holds seven 14 AWG insulated conductors, three grounds, one switch and internal clamps: 14 awg conductors 14, internal cable clamps 2, device yoke (14 awg) 4, grounding conductors (3 × 14 awg) 2, 22.00 in³ in all. An 18 in³ box is too small; a 22.5 in³ two-gang box or a 4" square box with a mud ring works.
A two-gang kitchen box with two 12/2 home runs and one 12/2 out (six conductors, three grounds) and two receptacles needs 24.75 in³ without clamps.
Conduit bodies and pull boxes
A conduit body (an LB or a T) with 6 AWG or smaller conductors may hold splices only if it is marked with its volume and is not a short-radius type (314.16(C)). With 4 AWG and larger conductors, pull and junction boxes are sized by the raceways instead of by volume: a straight pull needs a box at least 8 times the largest trade size long, an angle or U pull at least 6 times the largest trade size plus the other raceways on that wall (314.28).
Plastic boxes and extension rings
Nonmetallic boxes and boxes not listed in Table 314.16(A) carry their volume stamped inside (314.16(A)(2)); use that number. A plaster ring, mud ring or extension ring that is marked with its volume adds that volume to the box, which is the easiest fix for a box that comes up short.