The wiring in a typical residence can get complicated, and in an effort to keep track of what's what, electricians -- partly by convention -- assign certain colors to the wires in an electrical circuit. The National Electrical Code mandates particular colors for the ground wire and the neutral or return leg of a grounded circuit, but it doesn't say anything about the hot wires. This is ostensibly to prevent electricians from an over-reliance on color.

worker puts the wires
credit: IvanMikhaylov/iStock/Getty Images
Close-up view of worker handling electrical wires

Ground Wire Colors

Wire
credit: simarik/iStock/Getty Images
Group of different colored electrical wires

The grounding wire in your switch or outlet box isn't actually a part of the circuit -- but in terms of safety, it's the most important one, because it diverts anomalous current to earth and prevents fires and electrocution. The NEC requires the system grounding conductor to be covered with insulation that is green or green with yellow stripes, or it can be bare. In practice, the ground wire in most 120- and 240-volt circuits is bare, but if you run across a green wire, it's a ground wire. The NEC prohibits using ground wire colors for other conductors.

Neutral Wire Colors

Installation of electrical box
credit: -lvinst-/iStock/Getty Images
Worker installing a electrical box on a wall

The Institute of Electrical and Electronics Engineers defines the neutral wire in a circuit as the one with an equal potential between itself and all the other conductors. It's usually bonded to the case of the power supply and is more properly called the grounded conductor -- as opposed to the equipment grounding wire. A grounded conductor -- or neutral wire -- smaller than 4 AWG must be identified by a white or gray covering, or one with white stripes. Neutral wires larger than 4 AWG must be gray. In everyday residential wiring, the neutral wire is almost always white.

Hot Conductor Colors

Electric wire
credit: Roungchai/iStock/Getty Images
Variety of colored electrical wires for sale

Because the NEC doesn't specify a color for the hot conductor in a circuit, any color can be used except for those that identify the grounding or neutral wires. In practice, hot wires are either black or red in a 120- or 240-volt residential electric circuit. Black is the default color, and the wires in a 2-conductor cable with a ground wire are white and black. The two hot wires in 240-volt circuits -- which must be wired with 3-conductor cable -- are red and black. The voltage across either hot wire with respect to the neutral wire is the same -- 120 volts.

Special Cases

Bare wire ends
credit: Sziban/iStock/Getty Images
Yellow, blue and neutral wires in cable

You may see a red wire in a 120-volt circuit, and when you do, it usually has a particular significance. Two light switches that power the same fixture must be connected by a hot wire, and this wire is usually red. A 3-conductor cable may also be employed to connect a double switch to a ceiling fan that has a light fixture. The red wire may power the fan and the black wire the light switch, or, because no regulation prevents it, the opposite may be the case. The hot wires in certain fixtures may not be red or black -- they could be yellow, pink or even blue. You may need to consult a circuit diagram to decipher the wiring in such fixtures.