What do electrical wire color codes mean?

Don't be confused by the jumble of electrical wire colors. (Photo by Brandon Smith)

Don't be confused by the jumble of electrical wire colors. (Photo by Brandon Smith)

All residential A/C electrical wires made in the United States follow standard color codes that identify each wire's function in a circuit.

Knowing the electrical color code that dictates which wire does what is imperative not only in the correct configuration of an electrical system, but it's also paramount for your safety.

Be aware that all electrical wires, regardless of their function, could carry an electrical current at some point, so treat all wires with equal caution. Also, highly rated electricians note that older homes, built prior to the 1940s, might use different color codes if the wiring has never been upgraded.

Here are the common color codes used in electrical wiring.


Black electrical wire is used for power in all circuits. Any circuit's black wire should be considered hot or live. Black wire is never used for a ground or neutral wire and should be used as the power feed for a switch or an outlet. A black wire is often used in a circuit as a switch leg, the connection that runs from the switch to the electrical load.


Red electrical wire indicates the secondary live wires in a 220-volt circuit, used in some types of switch legs and in the interconnection between smoke detectors that are hard-wired into the power system. You can connect a red wire to another red wire or to a black wire.

Blue and yellow

Yellow and blue electrical wires are also used to carry power but are not for wiring the outlets for common plug-in electrical devices. These colors are used for the live wire pulled through conduit.

You'll use yellow mainly as switch legs to fans, structural lights and switched outlets. You'll use blue mainly as a traveler for a three-way or four-way switch.

White and gray

White and gray indicate a neutral wire. White is the color most often used for this function. A neutral wire connects to the neutral bus bar within an electric panel. (A bus bar is made of conductive metal that attracts the electric current for distribution outward to feeders.)

You can connect white and gray only to other white and gray wires. Although neutral, they can still carry current, particularly the unbalanced load — the electricity not being used and being returned to the electrical service. 


Green indicates the grounding of an electric circuit. A green wire can connect only to another green wire and should never connect to any other color wire. Green wires connect to the grounding terminal in an outlet box and run from the outlet box to the ground bus bar within an electric panel.

The purpose of the green wire is to provide a path to ground for a circuit's electric current if a live wire within the circuit happens to touch metal or some other conductive material. In the event of a fault, it could carry significant current, so treat green wires cautiously.

If you're apprehensive about dealing with electrical wires in your home, search Angie’s List for top-rated electricians in your area. 

Editor's note: This is an updated version of a story originally posted on Aug. 25, 2011.

More Like This

Is Knob and Tube Electrical Wiring Safe?


This contractor replaced knob and tube wiring, installed a new panel box and separated some high-volume rooms that were on the same circuit. (Photo courtesy of Angie’s List member Kari B. of Riverdale, Md.)
This contractor replaced knob and tube wiring, installed a new panel box and separated some high-volume rooms that were on the same circuit. (Photo courtesy of Angie’s List member Kari B. of Riverdale, Md.)

Does your older home have outdated knob and tube electrical wiring? Learn whether that type of wiring is safe, and what replacing knob and tube wiring costs.


There are four wires. A red, a yellow and 2 green wires. What are the 2 green wires for

We have pulled out a cupboard and found red and black wire out of the wall. Would like to put a light up but the fittings on the light requires 3. Can it be put up with 2 or should we cover up the wires?

This is a question....i sent for a touch lamp sensor..when i compared new to old new was way smaller box & wires im wondering should the wires themselves match in size? I feel theyshould..

I have a cord that has brown, blue, and white with a green line. which is the ground

In the midst of a ceiling fan replacement and have come across a wiring issue. House was built in 2006 and located in TN. The new fan is a mid-level Home Depot type with a lighting element. The issue is that the fan has red, white, and green wires only. However there are red, white, black, and copper (ground) coming out of the ceiling. Any ideas what I should do to rectify this situation? Can two of the house wires be connected to one of the fan wires? Thank you!

Your house is set up for a fan with a light on it.(black wire) The fan you purchased seems to have no light.(no black wire) Wire your fan red-red, white-white, green-ground, and cap the black wire. Try the switch after you wire it up. If the fan doesn't come on, first make sure you have power, then wire the red to the black and cap the red.

Buy a voltage tester. (Hot stick, wiggy) that will light up when you touch the insulation on the wire. Either the red or black is controlled by the switch. Turn switch on and off why testing to be sure which is which. Cap (put a wire nut on) the one that is not controlled by switch and use the one that is.

I have a two switch outlet on seperate circuits (one foyer and one coach lights). I want to place a timer on the coach lights. the old timer switch outlet wires had one pigtailed black and red, one white and a single black. The timer has a black (hot), white (load) and green (ground). I connected the timers hot (black) to the outlet hot (black/red) and the load (white) to the white and the green to the single black assuming it is a ground (note: this single black did not light up my meter when checked with the nuteral (white) so assuming it was a ground (not hot). Am I wiring this correctly? I did get power to the switch but it would quickly turn on/off and then after I waited a bit (switch has a load delay) it would do the same thing.

I'm replacing a ceiling fan/light kit, and the existing wiring is red/brown/green. The new fixture is white/black/green. Am I correct in assuming that red goes to black and brown to white?

I do not believe that is correct. Green obviously goes to green because that is your grounding wire. Red goes to black or black to red because those are your hot wires. Although a white wire should only ever be connected to another white or grey wire. White and grey wires are your neutral wires and those should never be connected to brown which is a hot wire.

The brown wire was more than likely a white wire. Due to excessive heat the white wire will turn brown. Excessive heat is caused by putting higher wattage lamps in than recommended.

I have an 3 wire 15A 125V extention cord that had both the plug in and the recepticle bad. I purchased two new ends with the proper three prongs, 1 male and 1 female. My question is where do the white, black, and green wires hook up. Thanks You!

black to the gold screw white to the silver and green to the green screw,

And this all depends on people installing the wiring correctly - I've lived in a house where half the wiring was reversed, and the white was the hot.

Many years ago when I was working as an electrician with a carpenter. He had his own motto about electrical work; "I know everything I need to know about electrical wiring and that is hands off" He was an Excellent Carpenter but never claimed to know or wanted to do electrical work.

very confusing because years ago there were basically no standards and people were being electocuted on a regular basis.national electrical code changed that in home wiring black is always hot and white is always neutral green is always ground and red is half of a 220 volt circuit. any thing else is wired wrong and neededs to be repaired. by a quafified electrician.

It should be noted at the outset that these comments pertain to architectural and AC appliance wiring, not automotive (DC 12 volt) wiring, in which red and brown are always hot, black is ground and various other colours are used to help visually separate circuits. Black is always a (-) ground.


you are incorrect. Black, Red & Blue are used on voltages up to 250v, all signify they are current carrying conductors. Neutral would be white, ground wires are either green or green with a yellow tracer. Brown, Orange and Yellow are all current carrying conductors used on voltages up to 480v.; gray is the neutral color, grounds are green and green w/ yellow tracer. The purpose of color coding is to standardize & identify the voltages available within the panel/junction box. Most commercial building use 208v and 480v. Residential is wired at 120/240v

Rod, all wires are "current carrying conductors". Even green and green/yel carry leakage current and sometimes full current to perform their safety functions. This article is rife with incorrect information, which could be dangerous to anyone who tries to rely on it. Wire color coding is very specific to the particular device/industry. While there are some standards, they only apply in some types of circuits. Black is not always hot. In DC circuits it is normally grounded. Sometimes it is normal to connect a white wire to a black wire in an AC circuit (switched circuits, for example). Untrained people should not mess with residential AC wiring.

true even the white wire carries 80 percent of the un balenced load, which means it will get you!

Thanks for the comments. We have updated the article to reflect these concerns and make it more clear that all wires can carry electrical loads and should be treated with caution. Paul F. P. Pogue, senior staff writer

What are the porpuse of colour coding?

The purpose of color coding wires is to properly identify the conductors designated for specific purposes. This will lessen the possibility of connecting or terminating conductrors improperly which may result in a variety of dangerous situations. For instance only the white conductor should be connected to the white screw or white wire on a receptacle or lighting fixture. Will the device normally continue to work if the white and black conductors are reversed? The answer is yes, but with potentially disasterous results. How will this happen, well for instance, all devices with a switch will turn off the power (Hot) supply to that device. If the wires are reversed, then the switch is opening and closing the neutral conductor and the device is still energized.

How does one connect a circuit if there is gray,black and brown wires

why use as colour code ryb as a elwctrical circuits

Short version -- the guy doing the wiring isn't clairvoyant and the next guy working on it is neither clairvoyant nor the one who actually did the initial wiring -- and there is a real need to know -- at both ends of a wire -- that it the same *one* wire. Before computers and glass fiber, the telephone company had thick black cables with 128 wires inside -- they only needed two for each telephone conversation, but it had to be the *same* two from Maine to California. So first, they made it into 64 pairs of two wires each (there were other advantages) and then using 6 colors and having a second color for the second wire (e.g. white & orange, white & blue, red & green) they could have a means of identifying each of the 64 pairs of wire. Think in terms of 64 very long extension cords all connected to different things a thousand miles away, and you have to know which *one* extension cord to plug in, with bad things happening were you to mistakenly plug in any of the wrong 63. The only reason the wire's insulation is colored is so that you can distinguish between them. And hence the black hot, white neutral which dates back to the days of "knob & tube" - exposed 1/4" copper wires on porcelain insulators - where you could clearly see where each wire went. You could see the hot wire going into the switch (this one *always* hot) and you could see the wire coming out that was only hot when the switch was turned on. Both are "hot" wires, but if you confuse the first for the second, or somehow connect the two together, the switch won't do anything -- nothing will happen when you turn the switch "off" because it has been bypassed. So you use a red wire coming out of the switch -- you know that the black one is *always* hot, and the red one is *sometimes* hot (i.e. when switched "on") and you connect the red (and not black) to your light fixture, connect the white to the other side of that, and, like magic, you have a light you can control with the wall switch. (CAVEAT: Always presume red is *always* hot unless you know otherwise, it's used for other things too.) And this is why you use sometimes use yellow for the wire from the switch to the light fixture -- you may already have red in the same conduit and don't want to confuse the two. Hence yellow being the wire coming from the switch, used ONLY for the lights that switch controls. After all, there may be reasons why the hot wire going *to* the switch is red instead of black, and were you to use two red wires on the switch, you'd have the same issues if you were using two black ones. Now say you want to have a switch at the top and bottom of the staircase so that you can turn the light on/off from either end -- a "3-way switch." Instead of the on/off switch, these are switches that are either/or -- there are two wires between them and the light goes on when both switches are connected to the *same one* -- and it doesn't matter which one is used, but each switch is hot and the light goes on when electricity can come in via one switch, go through either wire to the other switch, and then to the light. Otherwise, it is off. You need to distinguish the wires that connect the two switches from (a) the always hot, (b) the hot-when-on feeding the light, and (c) the neutral (and green ground if applicable). Hence the use of yellow and sometimes blue, and it gets a bit more complicated when you have a *4*-way switch -- any one of *three* switches able to turn a light on or off. Now this is assuming that whoever did the initial wiring was following the rules (think of the person that doesn't stop for the red light and the problems that can cause) -- and that everyone who has worked on it since then did likewise. If you see Aluminum wire (silver rather than copper-colored metal under the insulation), presume otherwise. While still used for big wires (e.g. the feed to the breaker box), the short version it that was used for the 15/20 amp circuits for a couple years in the 1970s until people realized (a) that it was more brittle than copper, (b) that it was breaking, and (c) it was causing fires. It often breaks inside a wall, and then whatever it was connected to stops working -- and people doing a good job simply yank it all out and replace with new copper wire. Or you get creative, and I once found the *ground* (not neutral) being used as the hot, with the outlet then grounded directly to the baseboard radiator -- it worked fine until the tenant tried to use an air conditioner.... The most important thing about wire color is not will something work if you get it wrong -- it usually will -- but what will happen if the next person presumes you did it the way you were supposed to -- and you didn't. Think of driving down the road, through a green light -- you are presuming that the 100,000 lb truck will stop for the red light and hence not sideswipe you.

black is used for power in all circuits? What about automotive circuits?

Excepting redundant grounds and things like the wire connecting the engine to the frame, ALL auto wires are hot. (The metal frame is used as the ground - which is why any bare wire will short out. With the exception of Orange and Yellow, which are reserved for airbags and high-voltage lines in hybrid/electric cars -- do not touch these -- automakers use whatever colors they please, and then what they do is put a stripe of a different color down the wire to further distinguish them. E.g. green with blue stripe. You need the wiring diagram of the specific car -- and often there will be wires not used in this particular car because they have the same wiring harness for lots of different cars. Manufacturers tend to have similar colors used for similar things, but you should not rely on that.

The color codes stated in the article refer to A.C.wiring. Cars use D.C. and it's a whole different color code with the exception of green as ground. In D.C., red is hot (positive) and black is ground (negative). If your question (and answer) is to help you diagnose a problem with your car, buy a meter. Also, your public library probably has an online data service that will let you obtain wiring diagrams for your car which include wire colors for each circuit (as well as other repair information). All you need is a library card.

In a DC circuit, red is positive and black is negative, but green is ground. There is a difference between earth ground (green) and what you call ground (negative). As for the flow of electrical current, you have to first decide if you are going to follow electron flow or conventional flow for the current. The two flow in opposite directions, which can make a difference in a coil.

Add comment


What is Angie's List?

Angie’s List is the trusted site where more than 3 million households go to get ratings and reviews on everything from home repair to health care. Stop guessing when it comes to hiring! Check Angie’s List to find out who does the best work in town.

Local Discounts

Daily deals up to 70% off popular home improvement projects from top-rated contractors on Angie’s List!