I just opened my ceiling light to replace it with another mount. I see a white wire connected to 2 black wires, is that right?
The middle switch controls this ceiling light.
Home Improvement Stack Exchange is a question and answer site for contractors and serious DIYers. It only takes a minute to sign up.Sign up to join this community
The cable with the white wire that's connected to the two black wires is a switch loop:
Normally wires with white insulation are used only for neutrals, but code makes an exception to allow for use of the white wire in a cable used as a switch loop as a hot rather than a neutral.
If you'll look closely in the drawing, the whites used as hots are wrapped with black tape to indicate they are being used as such. The wiring in the picture in the question lack this, which is a code violation. Of course the electricity can't see the tape so it's not intrinsically unsafe. However, it can be a hazard if someone working on the wiring makes a mistake because it's not labelled as clearly as it should be.
The fact that the white is with the blacks is very important. Most of what you need to know is in the positions of the existing wires; don't be in a hurry to tear it all apart, or you lose that critical info.
Color-coding is not by wire function, it's how cables are made.
That white has been reversed to be a hot. This is because it's in a switch loop, and no neutral is provided, so the neutral is re-tasked. (Today it's required to provide neutral). Because the neutral is re-tasked to be a hot, it must be marked with a few wraps of tape.
White is used for always-hot because another rule requires this. That's so when you're at the other end, it's easier to detect that the white Is hot, because it's always hot.
Once you have identified the neutral bundle(s) (all white), a white that's with mostly blacks is one of these. The fact this is in a lamp makes this most likely a switch loop.
Most likely its partner black is the switched-hot. The lamp will want this switched-hot, and actual neutral.
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?