Does wire color matter in electronics?

I'm fairly new to electronics here. But I can't seem to find any clear answer anywhere on the internet.

Are wires special depending on their color? Or they have all the same purpose with just colors to define them so people won't get confused? Say I wanted to reverse the black and red wires on a LED strip connected to a battery, would it still function properly or not?

Just been curious about it lately..

• When I was a kid, I got hold of a roll of wire with pink insulation - it was cheap, and I didn't have much money. I used pink wire for all connections because I saw no point in spending money on wire when I needed parts. Everything worked properly - despite the color. Finding mistakes in the wiring was no fun at all, though. "Does that pink wire go to +9V, or does this pink wire go to +9V?" Spent a lot of time tracing wires and measuring continuity. Made me really appreciate properly color coded wiring. – JRE Dec 3 at 16:44
• Since we're swapping stories... When I was a kid... I built a 3 band radio. It was working sporadically, and I realized I needed the inductors and trimmer caps properly tuned with a signal generator. Didn't have one, so took the radio to a local shop (those shops existed back then). The guy took one look inside the box, looked at me pitifully, and then opened up a radio on sale and showed me. All wires color coded, neatly laid flat and tied to the chassis, completely visible end to end. One can still find that on high end stuff nowadays. – Indraneel Dec 3 at 16:56
• The electricity flowing through a wire doesn't care about its color. – Mike Waters Dec 3 at 22:41
• Building codes in some countries mandate that certain wire colors be used or not used. Wire harnesses in vehicles may use color codes consistently (or they may not). But generally, in electronics, it doesn't matter too much. But you SHOULD use black for ground, and if possible, avoid using black for that which is not ground. If you use black for VCC and red for ground, someone may eventually have cause to curse your name in the future. – mkeith Dec 4 at 1:49
• One other point. Some wires are rated to be used outdoors and exposed to sunlight (UV). Black UV resistant wires probably hold up better to UV exposure than other colors. (A lot of people say this). But black wires that are NOT UV resistant won't hold up at all outside. – mkeith Dec 4 at 1:52

The colors do not matter electrically. A wire is a wire is a wire, regardless of the color of their insulation. The color of the wire itself may matter when you get into higher voltages, but that's about the type of metal used (aluminum vs copper conductivity, for example).

The colors may matter, for readability, adhering to standards, legal compliance. But that normally doesn't apply to individual projects. You can use red for ground and black for power, just be aware that someone may see it and be confused. The led strip doesn't care about the color, but it will when someone thinks well, red is positive and black is ground so let me connect it the right way and something breaks when they connect it to the power source.

• @Baldrickk No, of course it doesn't physically matter. If all you have on hand is a lime-green wire, sure, drop it in, maybe make a note of it -- but there's still a use for standards, even in solo projects. If you have red and black wires, you should use those for power and ground, so you don't need to check back with your notes. If you don't, it doesn't change anything electrically, obviously -- it just makes it harder to get back into that project, even if you're the only one working on it. – Nic Hartley Dec 4 at 17:59
• Comments are not for extended discussion (comments deleted) – W5VO Dec 4 at 18:32
• Even more when "something" that breaks is you, because the wire had significant current and mis-colored wiring led you to believe something really hot was safe. – Joel Coehoorn Dec 5 at 2:44
• @JoelCoehoorn well, electrically it is working properly. I guess getting killed wasn't exactly what you wanted to do, but the fact that you got killed means it works... – Nelson Dec 5 at 5:40
• A wire is a wire is a wire, regardless of the color of their insulation. the same rule applies to human! Great answer! – ptr_user7813604 Dec 8 at 16:48

Wire colors are like comments in code, even for simple DIY projects. You're talking to your future self. When you take it apart in five years because it stops working, you will have forgotten everything about the original design, so it really helps to follow conventions. For industrial products it is vital to respect norms and conventions because many people may be involved in maintenance. This is also why we have silkscreen on boards, with testpoints labeled like "there should be 5V here".

Say I wanted to reverse the black and red wires on a LED strip connected to a battery, would it still function properly or not?

It will work fine until someone tries to troubleshoot it and says "Ha! There's your problem, the polarity is reversed!"

I've seen it happen. On another forum, a guy completely destroyed a very expensive synthesizer because the wiring colors did not match the polarity, and out of all the people trying to help him, none thought about the fact that the manufacturer had actually used a lot of power supplies which had been wired the wrong way.

• +1 Although as a programmer I have often said it the other way round, "Comments in code are like wire colors in hardware." – A. I. Breveleri Dec 4 at 4:13
• Comments are not for extended discussion (comments deleted) – W5VO Dec 4 at 18:33
• Before I saw this answer I was thinking that the different wire colours are like giving variables sensible names. If all your variables are named $v[0], $v[1] ... $v[n], (e.g. in PHP where any variable can be any type) you'll spend forever trying to fix bugs in it. If you can tell the purpose by paying attention to the colour/name, it will be much easier to understand. – CJ Dennis Dec 5 at 0:13 Wire colour matters! Not for the current running though the wire but for troubleshooting, safety, and others that may encounter any project. At powerline level voltages, national regulatory bodies have mandated the 'hot' line to be certain colours such as red for power (and orange, black, or brown in multi-phase power) and green or green/yellow striped as the grounded conductor. In most low voltage DC systems I have encountered, red is positive and black is negative. It is so ingrained in our designs that people will assume it on a new system, and DIY products may only say 'connect red wire here'. When you breadboard a new design, it will not matter electrically what colours you have chosen, but it is rare for me to have completed a moderately complex build without at least one error. To troubleshoot your design is so much easier if you are consistent with what colours you have used for what part of the circuit. Colour choices can be somewhat arbitrary, but for a DC system, keep red for positive, black for ground. In other higher power systems, or RF, the wire colour or colour banding may be a manufacturing code that tells you what the internal makeup of the wire is. It could indicate insulation type (fire resistance, voltage rating) or conductor type (aluminum, copper, steel core) or other details. I worked in designing low voltage monitoring for high power systems. I was taught that red current only flows in red wires. Let me assure you that I have seen red current happily flowing in black wires until the molten copper explodes plating the room. I then kept the red current in the red wires. Always assume that wire colours means something if you are working on an existing device, even if all it means is that this blue wire is a different circuit than that violet wire. I have been a broke student and wired electronic prototypes with the one roll of red hookup wire I had. They eventually worked but I paid in time troubleshooting. My professional work used national electrical code wire colours in large gauge but the low voltage signals used a different colour combination, but the wires were physically different which also helped separate them. And in production, each product was the exact same to simplify the repair department work. So for your projects the positive and negative wires should have their own colour especially since this is where you often have to connect to external power, and then the signal(s) can have a third (or more) colour. If you have a small set of hookup wire spools, you can develop your own code particular to your projects; for example, blue for inputs, yellow for digital signals, violet for analog, and green for the output side. This will help you for years to come in troubleshooting. Remember that the colour is for your benefit and adjust your rules to your designs. If you keep the project, you can write the code down too. • What is 'red current'? It's a confusing statement given that current flows from negative to positive. – CramerTV Dec 4 at 2:56 • @CramerTV Given the tone of the answer, I think he said "red current" in a humorous way, refering to a current that, back then, should be only in red cables. It is not fair to downvote this answer for this. Just upwards there is a humorous comment about energy runing fast in red wire that received a lot of upvotes - it's a good thing that someone can smile on this. – mguima Dec 4 at 10:17 • @CramerTV: it's even more confusing if you mix up words. Electrons flow from negative to positive voltage. – Guimoute Dec 7 at 10:14 • @mguima, While humor is a great thing in ordinary life, when giving answers I think it is important to ensure the answers are clear and unambiguous - especially for newbies and for those who don't speak English natively. These sites show up in nearly every country around the world and making them as clear and concise as possible is something I believe is important, especially when dealing with potentially dangerous things like electricity. Also, I did not downvote so am unsure why any mention of that was made. – CramerTV Dec 7 at 16:58 • @mguima there's a difference of it being in an answer vs a comment, a comment which was deleted for some reason. – Passerby Dec 8 at 17:47 There are some color code conventions for low voltage (<24V) DC wiring: Red is usually the positive supply line. Black is usually ground. If there are multiple positive supplies, they will have other hot colors applied (brown, yellow, orange). Pay attention that this is totally different from AC color codes. Do not mix these two under any circumstances. • An explanation about why not to mix these two under any circumstances would be a great addition to the answer. – WoJ Dec 3 at 21:39 • Do Not assume these colours apply to cars... on some English cars brown is live (not fused) and on German cars brown is earth or ground... :) hours of fun sorting out burnt wires after getting those mixed up... – Solar Mike Dec 3 at 22:27 • Just an addition: in computer hardware, usually yellow is 12v, orange is 3.3v, and red is 5v. I've never seen an environment where those three voltages were present, and this pattern wasn't used. – mguima Dec 4 at 10:19 • @WoJ Well I know of at least four different AC color codes (US, old German, old UK, European standard), and I suspect there are many more. They are all incompatible. – Martin Bonner Dec 4 at 13:04 • @MartinBonner I believe USSR/China uses green as a phase colour. – Someone Somewhere Dec 5 at 7:52 As noted, color does not matter, but it does make life easier when assembling and/or debugging. Insulation type Does matter - for High Voltages (think tube amplifiers), direct underground, high temperature environments, durability. And then wire type depending on usage - single wires for breadboard, bundles of say 2 or 4 wires (speaker cord, lamp cord, or 4 for telephone line), twisted pair wire in othernet cable (4 pairs), shielded wire (microphone cable), bundles inside inside shielding (security system wire), twisted pair inside shielding with power & Gnd (USB cable?). Then there's wire strands (single wire, not too flexible, or multiple strands, for more flexibility) and wire gage - 30 AWG single strand for wire-wrapping, 26 AWG solid for breadboard, #2 stranded (Car battery terminals) and all kinds of stuff in between. • I've normally used 22 solid for breadboarding purposes, seems to fit into .1" pin headers nicely - perhaps there are different size breadboards that use 26awg? – user2813274 Dec 4 at 2:54 • I could be off a size or two on the breadboard wiring, has been a while since I've done any. Too thick tho and it just mashes the spring contacts apart and ruins them. – CrossRoads Dec 4 at 5:04 • In the late 1970s I worked as a "wireman", wiring equipment for a company supplying the UK military. You would mount boards, connectors, switches, controls, etc, in a steel cabinet and then wire it all together using wires of specified length, in a harness, all laced together using "lacing cord", and all these wires were the same colour. Pink. – Michael Harvey Dec 4 at 19:41 Low voltage and "inside the box", color does not matter too much. There are two situations though where there are standards, one of them very important: AC "Mains" Power Colors for AC power do vary somewhat around the world. In the US, the general colors are: • White or Gray = Neutral • Green or bare = Ground • All other colors = Hot. For a number of reasons, the most common colors typically for hot (at least in residential applications) are Black followed by Red. Anyone who works on 120V (and above) AC power should always treat any unknown wire as potentially hot, but when wiring is done properly, these standard colors help a lot to keep things straight and safe. "Standard" Power Supplies A classic example of de facto color coding is the ATX Power Supply. See the link for details, but it includes multiple wires of the same color for a given use including: • Orange = +3.3V • Black = Ground • Red = +5V • Yellow = +12V Most people will never do more with an ATX power supply than swap one for another, and the connector only fits one way. But if you need to splice into one or are trying to build your own or do something else out of the ordinary with it, then sticking to the standard colors can make your life much easier. • Just note that AC mains wire colours vary between countries. In the UK Blue is Neutral, Brown is Hot (as are Black and Grey in three phase). Old UK standard had Red as Hot and Black as Neutral. As ever, when in doubt refer to local standards. – Tom Carpenter Dec 3 at 22:45 • Which is why I started off with Colors for AC power do vary somewhat around the world – manassehkatz Dec 3 at 23:17 • missed that, my bad. – Tom Carpenter Dec 4 at 9:23 • I think that the risk involved is inversely proportional to the reliability of the color codes. When dealing with AC, I think that is not advisable to consider that a wire is neutral only because it is white or gray (even if I did that installation myself - I confess that I would not swear that I've always observed the patterns). First thing to do is test / measure all the wires to discover if the color codes were used or not. – mguima Dec 4 at 10:03 • Not to mention countries that have changed colour codes, such as the UK and much of Europe. – Someone Somewhere Dec 5 at 7:55 Yes, the wire colors matter - just imagine when agent 007 opens up the box where there are 7 seconds left on the timer, wire cutters in hand, asks "which wire do I cut, they are all the same shade of grey?" Unless you are a diabolical bomb maker & your intentions are to obfuscate your design, sticking to standard colors is highly reccomended for not just others, but even yourself to understand what you have done • And if you are a diabolical bomb maker and you use all grey wires, sooner or later you will blow yourself up. – A. I. Breveleri Dec 4 at 4:15 • – davidbak Dec 4 at 4:33 • @A.I.Breveleri the chances of blowing yourself up as a diabolical bomb maker are high either way, but provided you use some other means of organisation (and properly test the circuits without live explosive attached), that risk doesn't go up that much more by the use of grey wires only. – leftaroundabout Dec 4 at 10:10 • @davidbak it's considered good etiquette to put a big warning before any TVTropes link you post on StackExchange... like you also wouldn't pack a mail bomb without an “explosive hazard” sign, right? (Or with all-grey wiring...) – leftaroundabout Dec 4 at 10:16 • @davidbak The Evil Overlord list provides plenty of advice. #15 seems applicable here. From cellblock A, #136 applies to OP's scenario. Warning: TV Tropes. – a CVn Dec 4 at 14:46 Mark 'em yourself This 5-pack of electrical tape is$4.

You don't have any particular obligation in homebrew electronics wiring (except to yourself, as confusing wires will waste a LOT of your time). The convention is red for positive and black for negative, particularly in a negative ground context.

However in mains wiring, you have some obligatory colors.

• Equipment safety earthing must be green, green/yellow or bare.
• If an active conductor is near earth voltage, it is called neutral, and it must be white or gray in North America or Philippines, and light blue in the rest of the world (black in Au/NZ).
• "hot compared to earth" conductors are particular colors: much of the world brown then black then gray, North America any unreserved color (except orange for the high leg in 240V wild-leg) but convention is black then red then blue.
• Also, in North America, the three colors used for well pump wires are usually red, black and yellow. – mkeith Dec 8 at 2:51

Color codes in wiring are regulated by ISO IEC 60445: 2017 "Basic and safety principles for man-machine interface, marking and identification - Identification of equipment terminals, conductor terminations and conductors".

IEC 60445:2017 applies to the identification and marking of terminals of electrical equipment such as resistors, fuses, relays, contactors, transformers, rotating machines and, wherever applicable, to combinations of such equipment (e.g. assemblies), and also applies to the identification of terminations of certain designated conductors. It also provides general rules for the use of certain colours or alphanumeric notations to identify conductors with the aim of avoiding ambiguity and ensuring safe operation. These conductor colours or alphanumeric notations are intended to be applied in cables or cores, busbars, electrical equipment and installations. This basic safety publication is primarily intended for use by technical committees in the preparation of standards in accordance with the principles laid down in IEC Guide 104 and ISO/IEC Guide 51. It has the status of a basic safety publication in accordance with IEC Guide 104. This sixth edition cancels and replaces the fifth edition of IEC 60445, published in 2010.

In EU - and surely in Italy, were I live - standard norms issued by ISO, EN and UNI (Italian National Standards Organization) have force of law, and whoever wants to build anything must comply with all relevant and applicable standard norms.

In particular, compliancy with safety publications is strictly mandatory. Failure to comply will certainly lead to liability and prosecution in case of damages and/or injuries, not to mention death.

So, the answer is, "yes, wire colors matter in electronics"

New contributor
iw1dov is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.