When you remove a hardwired light fixture from its mounting either to replace it or resolve an issue, you'll notice that one of the circuit wires to which it's connected is white, one is bare or green and one is either black or red. The white wire is the neutral or return leg of the circuit, the green is the ground wire, making the black or red wire the hot one. Electrical convention and the National Electric Code prescribe these colors, as described on the International Municipal Signal Association website. Not all lamp makers follow them, so the wires in the fixture may have different colors.
Light Fixture Wires That Are Not Color Coded
Light fixtures manufactured in the United States must follow the color-coding rules established by the NEC. However, the NEC has only one requirement, and that is that the neutral wire must be white or gray. Most North American manufacturers make the hot wire black and the ground wire green, but they don't have to. Moreover, lights that originate outside the United States may have a different color code, so some chandelier wires aren't marked.
Video of the Day
If you see a brown wire in a ceiling light, it could be the hot or ground wire, but probably not the neutral. You can identify the wires with a multimeter, but the two-part test requires the light to be energized. For your safety, wear rubber gloves when conducting it.
Determine Hot and Neutral Wire With Multimeter
The first part of the test measures resistance to identify the ground wire, and you conduct it with the power off, the fixture connected to the circuit wires and the bulbs removed from the sockets. You don't have to conduct this test if the fixture has a ground terminal instead of a wire because the terminal is easily identified as the ground.
To conduct the ground test, remove the bulbs, unscrew the caps from the wires inside the fixture, but leave the wires connected, and set the multimeter to measure resistance. Touch the leads to any two wire connections and note the resistance reading. If you get a very high or infinite resistance, it means the two wires you're touching are the hot and neutral and the third wire is the ground. If the resistance is zero, one of the wires you're touching is the ground.
Now for the second part of the test. Turn on the power, set the meter to read volts and touch one lead to the ground while you touch the other lead to either of the other wires. If the voltage reads close to 120 volts, you've found the hot wire, but if the voltage is zero, it's the neutral because power can't run from neutral to ground with the bulbs removed.
Hot and Neutral Lamp Cord
If you're replacing a polarized plug on a lamp cord, which has one prong wider than the other (the neutral wire attaches to the wider prong), you have to distinguish between hot and neutral or you could reverse the polarization and make the lamp a shock hazard. The wires aren't color coded on a lamp cord, but manufacturers do provide a way to tell them apart.
If one of the wires has a white stripe or you can feel ribbing on it, it's the neutral wire. The wires are encased in rubber, but sometimes they have an extra layer of insulation. If so, the one with the white insulation is neutral. If you can't find any difference between the wires, the lamp isn't polarized. You can replace the plug with a nonpolarized one that has prongs of the same size.