I am trying to replace my ceiling lamp. I have wiring which looks like this: enter image description here

I am trying to figure which one is the hot, neutral and ground wire. The voltage detector beeps when brought close to the wires with red caps(one red cap has three wires going in and another a single wire) and doesn't when brought close to the wires with yellow cap (two wires going into the cap). Though I see sparks when opening the yellow cap (and lights nearby blink). Is it possible to tell with this information? Any help is appreciated. Thanks!

4 Answers 4


The cap colors have nothing to do with it

The color codes say the **size and quantity* of wires they're designed for. For instance yellow can bind up to 3 14AWG wires, but red can bind up to 6. Their ranges overlap broadly.

It's all about the wire colors, except...

A bare, green, or green/yellow wire is always a ground. Not every installation has grounds. They are often pushed up into the back of the box.

A gray or white wire (light blue in Europe/rest of world) is a neutral, except it can be tagged with tape to use as a "hot". People often forget to tag the wires with tape, especially when the use is obvious.

Any other wire color can only be a hot. You should not mark a hot to be a neutral or ground. But you can't count on the last guy doing right.

So here's what we know

  • The black-black bundle can only be hots.
  • The white-white bundle is certainly the actual neutrals.
  • The black-white bundle, the black must be a hot, so the white must be a hot that should have been marked with tape, and wasn't (typically because the use is "obvious"). Here, the obvious use would be for a switch loop.

In a switch loop, you have a black and (should be marked) white going down to the switch. The switch shorts them together to light the light. There's no standard which wire is always-hot and which is switched-hot. So realistically the switched-hot will be either wire.

Your lamp needs neutral and switched-hot. The neutral is easy; the switched-hot will be one of the others. You can guess, but if you guess wrong, the lamp will be on continuously and won't respond to the switch. That's exactly what you do to find out.

Ground wires are not readily visible in your photo. You'll have to look closer in the back of the box. Some light circuits are ungrounded; in which case there is nothing to attach to. Normally you have to replace a whole cable, not run a single wire; but as of 2014 it is legal to retrofit just a ground wire, if you really want to.

  • Not all red wire nuts are equal. Just have a look at this URL(idealind.com/us/en/products/wire-termination/…)
    – Kris
    May 13, 2017 at 19:47
  • I can see a bare copper wire in the middle of the photo. It's behind the black and white wires
    – craig65535
    May 13, 2017 at 21:23
  • Great! Thanks for all your comments. I connected the black wire from the lamp to the red cap with single black wire and white wire from lamp to the yellow cap and it is working great . Also thanks for noticing the copper wire in the middle. I overlooked it.
    – Dadi
    May 13, 2017 at 21:31
  • 1
    You cannot mark a hot to be a neutral or ground Yes you can, or you can use any color or even a bare wire as a neutral or hot without marking it at all. It may be against code, but there's no physical reason a homeowner can't do something unexpected. So consider all possibilities when looking at unknown wiring that may have been wired by a non-professional -- so test all wires before touching them, not just what you think is the "hot".
    – Johnny
    May 13, 2017 at 23:17
  • 1
    @gregmac I revised the language after Johnny made the comment, "should" is exactly the right word. May 16, 2017 at 16:22

Common Switch leg configuration

The white/black wires twisted together is permanent hot -- turn off the breaker first if you wish and push it back out of the way. The two whites are neutral and the white on the fixture wires to them. The single black wire is a switched hot and is what the fixture black wires to. Way in the back are bare grounds twisted together. Those wire to the fixture bare copper ground.

The lights flicker because other lights share the neutral.

  • 1
    Followed as you mentioned. It works great! Thank you!
    – Dadi
    May 13, 2017 at 21:36

The yellow wire nut is your neutral. The grounding wire is always green or bare. The white that appears to be attached to a black is probably part of a switch leg. It should be marked with tape or another means of identification, but it would not be the first time it wasn't. The problem with a voltage detector is that it's a proximity detector. Meaning it detects voltage in the area of the box so unless you can separate the wires far enough apart, the voltage detector will signal on every wire in the box. You might want to check it out with a voltmeter which you can probably buy a cheap one for less than 20 dollars.

  1. The ground wire is the bare copper that is buried in the back.
  2. The neutral is the yellow capped bundle
  3. The lone red cap is likely your line from the power switch. You can test that by turning the switch on and off and seeing if there is power present (use a non-contact tester)
  4. The bundled red cap wires are pass through line power that is going to other lights, receptacles, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.