The National Fire Protection Association publishes the National Electric Code, or NEC, which is adopted by nearly every building code jurisdiction in the United States and is used as a model for building codes in other countries. These codes cover the installation and placement of residential circuit breaker boxes, including main service panels and subpanels.
Circuit breaker boxes may not be installed in bathrooms, powder rooms, clothes closets or in any room where there is insufficient space for a worker to access and work on the box. The space immediately in front of the box must be clear, and the box must be accessible. Clearance provided in front of the box must be 36 inches deep, measured out from the front of the box, and 30 inches wide, measured from the center of the box and from the floor to the structural ceiling. The ceiling must be at least 78 inches high from the floor.
Circuit Breaker Box Location
The NEC specifies that the location of the breaker box "must be as close as practical" to the service entrance. This allows some leeway in the location of the breaker box, but also restricts it. You should not locate a box on the opposite side of the home from the meter. In general, this restriction in the NEC encourages you to determine the circuit breaker box location and from that determine the service entrance equipment location. The service entrance equipment includes the meter, meter base, outside disconnect and the mast extending up through the roof. For example, don't run the service wiring 30 feet inside the house before you connect it to the main circuit breaker box.
Service Entrance Location
There are restrictions on where the service entrance may be located, and this will affect possible locations for the main circuit breaker box. The utility company's rules often override the NEC rules, and other local codes may apply as well. An area 30 inches wide by 36 inches deep, measured from the center of the service equipment, and 78 inches high, measured from the ground, must be clear of obstructions, including ground rods and water pipes. The center of the meter must be 44 to 66 inches off the ground. If the service entrance includes the circuit breaker, the highest switch may not be more than 79 inches from the ground. The service entrance must not be located within 3 feet of the utility side of the gas meter or within 10 inches of the customer side of the gas meter.
The rules and restrictions on the placement of circuit breaker boxes are meant to make the installation safe, and that includes common-sense precautions. Although a location may meet the strict definition of the code, it may not make sense to put it there. For example, locating the main circuit breaker box in an attic where it is not readily accessible does not make good sense — in an emergency it would be difficult to shut off a circuit breaker. Local code inspectors would probably not allow a new installation in that location. The "Authority Having Jurisdiction" rules and regulations take precedence over the NEC codes. This allows utility companies and local building code authorities to make exceptions in special circumstances and to amend the NEC as necessary for local use.