The outlet behind a nightstand is usually about a foot off the floor, which means reaching down behind the table every night to plug in a phone. That height, somewhere between 12 and 16 inches for outlets, and the 48 inches or so used for light switches are habits passed from one electrician to the next.
The electrical code used across most of the US has a good deal to say about how many outlets a room needs and how far apart they go, and very little about how high, with the kitchen counter as the main exception. So an outlet planned for the lamp, the television, or the bedside charger can go where its plug will be, instead of behind the furniture at the usual height.
What the Code Sets and What It Leaves Open
The rules that shape where outlets go in a house are about spacing and location more than height. Along the walls of living rooms, bedrooms, and similar rooms, outlets are spaced so that no point along the floor line is more than 6 feet from one, which works out to no more than 12 feet apart, and any stretch of wall 2 feet wide or more counts.
Three rules are more specific. Outlets serving a kitchen counter can be no more than 20 inches above it. A bathroom needs at least one outlet within 3 feet of the outside edge of each basin. And outlets in kitchens and bathrooms need ground-fault (GFCI) protection.
Local codes adopt different editions and add rules of their own, and electrical work usually needs a permit. The building department or a licensed electrician has the final word on any of this.
Outlets Near the Floor

The common height for an ordinary wall outlet is 12 to 16 inches, but trades disagree on where they measure to. Some mean the bottom of the electrical box, others its center, so ask which one before a number is agreed. Measure from the finished floor. Tile, a thick wood floor, or a new layer laid later all raise the floor and bring an outlet closer to it.
Low outlets disappear behind furniture, which is the point for a lamp cord running down the wall behind a sofa. They are also the hardest to reach. For anyone who finds bending difficult, raising outlets to 15 to 18 inches helps, and 15 inches is the lowest point accessible design allows for something people need to reach.
Above a Kitchen Counter

Kitchen counters are usually about 36 inches high, and outlets above them generally go 4 to 8 inches above the counter surface, which puts them roughly 40 to 44 inches from the floor. That clears a short backsplash ledge and keeps the plug close to where a kettle or mixer stands. The 20 inch limit, about 56 inches from the floor, rarely comes into play except under tall upper cabinets or on an open wall.
A full tiled backsplash is easier to lay out when the outlets are placed against the tile courses before the wall is tiled, so a box doesn’t land across a grout line. Outlets laid on their side, or mounted along the underside of the upper cabinets, keep a tiled wall clearer. Rules for outlets on islands have changed in recent editions of the code, so check which edition applies before planning one.
Beside a Bathroom Vanity

The outlet that serves a basin has to be within 3 feet of its outside edge, and it usually goes on the wall beside the mirror, a few inches above the vanity top. With vanities now often 34 to 36 inches high, that’s about 40 to 44 inches from the floor, the same height as a kitchen outlet.
Keep it to the side of the basin, out of the line of splashes from the tap. A hairdryer or an electric toothbrush that lives in the vanity can have an outlet inside the cabinet as well, so its cord doesn’t stay draped across the counter.
Light Switches

The usual switch height is about 48 inches, measured in some trades to the top of the box and in others to its center, so the switch ends up somewhere around 44 to 48 inches from the floor. Accessible design sets 48 inches as the highest point for a control people need to reach, so a switch at the usual height already sits within it. Set lower, nearer the height of the door handle, a switch is easier for children and for someone in a wheelchair to reach.
The switch goes on the latch side of the door, where a hand reaches as the door opens, and a few inches clear of the casing so its plate doesn’t overlap the trim.
Outlets Placed for the Furniture

The most useful outlets are the ones planned for a particular piece of furniture. Behind a wall-mounted television, an outlet near the bracket, with the center of the screen at about 42 inches, keeps the cord hidden behind the screen instead of hanging below it.
Over a desk about 29 to 30 inches high, an outlet a few inches above the desk surface puts chargers within reach without anyone crawling underneath. Beside a bed, an outlet a few inches above the top of the nightstand, which usually stands about level with the mattress, can be reached from the bed without moving anything.