Will a smart switch fit in my electrical box, and how deep does the box need to be?

Two separate tests decide it: the code's box fill count, which ignores how big the switch is, and the manufacturer's minimum depth, which is only about how big the switch is. A box has to pass both.

Two tests, and why people mix them up#

Two answers circulate for this question: "check your box fill", and "the code does not care what switch you install". Both are right, because they answer different tests.

Box fill is a code test, and it does not measure the switch. The National Electrical Code counts each device yoke as a double volume allowance "based on the largest conductor connected to" it, in the words of section 314.16(B)(4) as carried in the 2024 International Residential Code. A 14 AWG conductor is worth 2.0 cubic inches, so any switch on 14 AWG wire costs 4.0 cubic inches of box volume. A toggle and a smart dimmer cost the same. Nothing in the formula looks at the body of the device.

Minimum depth is a manufacturer test, and it only measures the switch. Lutron, Leviton and TP-Link each publish a box depth in their installation documents. That figure is a condition of their installation instructions, and a box that passes fill can still be too shallow for it.

If you were told "your box fill is fine" and still cannot push the switch in, you passed one test and failed the other.

Test one: the manufacturer's minimum depth#

These are the figures in each manufacturer's own documents, as of September 2026.

DeviceWhat the document requiresSource document
Lutron Caseta in-wall switch, PD-5WS-DV and PD-6ANS1-gang US wallbox, 3 1/2 in (89 mm) depth recommended, 2 1/4 in (57 mm) minimumLutron spec submittal 369831
Lutron Caseta dimmers and switches, including PD-5ANS, PD-6WCL, PD-5NE, PD-10NXDSame: 3 1/2 in recommended, 2 1/4 in minimumLutron spec submittals 369987 and 369919
Lutron Caseta fan control, PD-FSQN2 1/2 in (63.5 mm) minimumLutron spec submittal 369987
Leviton Decora Smart Wi-Fi Switch, 2nd gen (D215S, Matter)Recommended minimum wall box depth 2 3/4 inLeviton D215S manual
Leviton Decora Smart Wi-Fi ELV/LED dimmer (D2ELV)Recommended minimum wallbox depth 2 3/4 inLeviton D2ELV sheet
Leviton Decora Smart Wi-Fi switch, 1st gen (DW15S)Recommended minimum wall box depth 2 3/4 inLeviton DW15S sheet
TP-Link Kasa KS205 switch and KS225 dimmerUL listed outlet box with height over 2.95 in (75 mm), width over 1.81 in (46 mm), depth over 2 in (51 mm)TP-Link KS205 and KS225 user guides

Leviton sits at 2 3/4 in for every Decora Smart switch and dimmer we checked, across both generations. So a box that is 2 1/2 in deep takes a Caseta switch at its minimum and a Kasa switch, but falls short of what Leviton asks for. None of them publishes a figure that permits a 2 in box.

Test two: box fill, worked for real one-gang boxes#

The count is the same for every switch, smart or not. From the code text (NEC 314.16(B), as carried in the 2024 residential code):

So the neutral pigtail a smart switch needs costs no box fill at all. It costs physical space, which is a depth problem.

"Two cables" is power in and a cable out to the light, the common case where a neutral bundle is present. "Three cables" is power in, power continuing to another outlet, and a cable to the light.

One-gang box with a single switch14 AWG (15 A circuit)12 AWG (20 A circuit)
Two cables, no internal clamps4 conductors 8.0 + grounds 2.0 + yoke 4.0 = 14.0 cu in9.0 + 2.25 + 4.5 = 15.75 cu in
Two cables, internal clamps16.0 cu in18.0 cu in
Three cables, no internal clamps6 conductors 12.0 + grounds 2.0 + yoke 4.0 = 18.0 cu in13.5 + 2.25 + 4.5 = 20.25 cu in
Three cables, internal clamps20.0 cu in22.5 cu in

Three grounds still count as one allowance, because the quarter-allowance rule only starts at the fifth. You only meet that in multi-gang boxes.

Both tests against real boxes#

Carlon's own catalog and datasheet give the figures for common one-gang PVC boxes:

Carlon boxTypeVolumeDepthInternal clamps listedTwo 14 AWG cables (14.0 or 16.0)Three 14 AWG cables (18.0 or 20.0)Depth test
B117RSW / B117RSWROld work, shallow17.0 cu in2.00 inNoPassesFailsFails all three brands
B114ROld work14.0 cu in2 3/4 inIntegralFails (16.0)FailsPasses all three
B118ANew work, nail-on18.0 cu in2 7/8 inNoPassesPasses exactlyPasses all three
B120ROld work20.0 cu in3 5/8 inIntegralPassesPasses exactlyPasses all, including Lutron's 3 1/2 in recommendation
B122ANew work, nail-on22.0 cu in3 1/2 inNoPassesPasses (also at 12 AWG, 20.25)Passes all, meets Lutron's recommendation

The B117RSWR is the clearest case. Carlon sells it as a shallow old-work box, and 17 cubic inches is plenty of volume for a two-cable switch location, even on 12 AWG wire. Yet at 2.00 in deep it is under Lutron's 2 1/4 in minimum, under Leviton's 2 3/4 in, and fails Kasa's "more than 2 in" by definition.

The B114R is the opposite trap: deep enough, but its 14 cubic inches with integral clamps cannot hold even the two-cable case at 16.0.

Two-gang and three-gang boxes#

In a multi-gang box, add a double allowance for each switch. ExpertCE's worked example is a 32 cubic inch two-gang plastic box with two switches and four 12/2 cables: eight insulated conductors, four grounds counted as one, two yokes at two allowances each, 13 allowances at 2.25 cubic inches, or 29.25 cubic inches. It passes. Add a fifth cable and, under the current text, two more conductors plus a quarter allowance for the fifth ground take it to 34.3, over the 32 available. Older summaries written against the 2017 code, such as JADE Learning's, count all grounds as one allowance with no quarter rule, so check which edition your jurisdiction has adopted.

A device wider than a single 2 in device box gets a double allowance for each gang it needs; Decora-format smart switches mount on one yoke and count once. Width is also physical. Lutron's drawings show side fins on Caseta switches that are removed where switches sit next to each other (inside fins on the end switches, all fins on middle ones), and its spec states that "when ganging with other switches in the same wallbox, derating is required", which lowers the load each switch may carry. Smart switches, dimmers and the neutral wire covers the wider checklist, including gang width.

If your box fails: the fixes, in order#

  1. Recount before you buy anything

    Count your cables, check for internal clamps, read the stamped volume, and do the sum from the table above. A two-cable location on 14 AWG needs 14.0 cubic inches, or 16.0 with internal clamps.

  2. A box extender, only if the box is recessed

    Arlington describes its BE1 extender as leveling and supporting the device "where the box is set back from the wall surface", extending the box up to 1 1/2 in. That is the case it solves: a box sunk behind paneling, tile or a thick plaster skim. On a box already flush with the wall, an extender cannot add depth behind the plate without holding the switch proud of the wall, so it is not the fix there.

  3. A deeper old-work box

    Replacing the box is the real fix for a shallow flush box. An old-work box installs from the front of a finished wall. The Carlon B120R above mounts with ears and a swing bracket and gives 20 cubic inches and 3 5/8 in of depth. This is mains work in the wall cavity, and the part of this job most worth handing to an electrician.

  4. Skip the box: a no-wiring control

    Leave the existing switch alone, put smart bulbs in the fixture and mount a battery remote on the wall. Lutron's Dimmer PRO spec sheet lists a wallbox mounting adapter (PICO-WBX-ADAPT) for its Pico remotes. Nothing in the box changes, which also makes this the answer for renters.

A variation on the last option moves the smarts to the fixture with an in-canopy relay module, covered in the neutral wire guide, and smart lighting that stays compatible is the page for choosing between bulbs, switches and fixtures when the wall box rules the switch out.

The remote has one cost unrelated to the box: a mains-powered Z-Wave, Zigbee or Thread switch relays traffic for its neighbors, and a battery remote does not. If that switch was going to hold your mesh together, read mesh design for Thread or Z-Wave and Z-Wave Long Range before trading it away, and consider a smart plug nearby as the replacement repeater.

Which switch to buy when depth is tight#

With a shallow box you cannot replace, the depth table is the buying guide: Kasa's "more than 2 in" is the lowest published requirement, Caseta's 2 1/4 in minimum next. That choice drags other decisions with it. Kasa switches are Wi-Fi devices, with the tradeoffs in the hidden costs of Wi-Fi smart devices. Caseta runs on Lutron's own Clear Connect radio, the case made in proprietary radios: Lutron, Hue, Tuya and friends, and it matters for what keeps working in an internet outage. Buy for the box first, then check the platform in the compatibility checker.

Where these numbers stop applying#

If the switch is part of a larger project, moving an old smart home onto standards explains why a working hardwired switch is often the last thing worth replacing, and the pre-purchase checklist puts box depth next to the neutral and 3-way checks.

How deep does an electrical box need to be for a smart switch?

Each brand publishes its own figure. Lutron Caseta requires at least 2 1/4 in and recommends 3 1/2 in. Leviton Decora Smart recommends at least 2 3/4 in. TP-Link Kasa asks for a box deeper than 2 in. A 2 in shallow box fails all three, even when its volume is fine.

Does a smart switch count more toward box fill than a regular switch?

No. The NEC counts each device yoke as two conductor allowances based on the largest wire connected to it, whatever the device's size. On 14 AWG that is 4.0 cubic inches for a toggle and for a smart dimmer alike. The neutral pigtail a smart switch adds is not counted either, because it never leaves the box.

How many cubic inches does a one-gang box need for a smart switch?

With two 14 AWG cables and no internal clamps, 14.0 cubic inches. With internal clamps, 16.0. With three 14 AWG cables, 18.0, or 20.0 with clamps. On 12 AWG wire the figures are 15.75, 18.0, 20.25 and 22.5.

Will a box extender make my box deep enough for a smart switch?

Only if the box is set back from the wall surface. Arlington describes its BE1 extender as supporting the device where the box is recessed, extending it up to 1 1/2 in. On a box already flush with the wall, an extender cannot add depth behind the plate, so replacing the box with a deeper old-work box is the fix.

Primary sources

Specification and vendor documentation we checked while writing this page. Where a claim depends on firmware behaviour rather than a published spec, the page says so inline.