How do you calculate box fill?
Count one volume allowance for each insulated wire that enters the box, one for all the grounds together, two for each switch or receptacle, and one for internal cable clamps. Multiply by the allowance for the wire size: 2 cu in for #14, 2.25 for #12, 2.5 for #10, 3 for #8 and 5 for #6 (NEC 314.16(B)). The total must not be more than the box volume.