How to wire a socket outlet: line, neutral and earth explained
Which conductor goes on which terminal of a socket, what the colours mean, why the earth and the right polarity matter even though a lamp lights either way, which breaker and RCD protect the circuit, and how the wiring is tested.
Also in: Polski · Português (Brasil) · Deutsch

Transcript
A socket outlet: three terminals, and each wire has to be on the right one. This is the socket outlet exercise in WireWhy's free course. The socket must be live, with line and neutral the right way round and the earth connected.
The supply, with line, neutral and protective earth, and a 16 amp breaker for the circuit. The socket has three terminals: L for the line, N for the neutral, and PE for the protective earth, which goes to the earthing pin or clips.
The line from the supply into the breaker, and out of the breaker to the socket's L. The neutral comes straight from the supply to the socket's N. And the protective earth straight to the socket's PE: never through a breaker or a switch.
Check my work: the socket is live, the right way round, earthed, and nothing trips. In the realistic view, it's the socket you'd see on the wall.
The classic mistake: line and neutral swapped at the socket. A lamp plugged in would still light, so it looks fine. But the line is now where the neutral should be, and anything switched off by a single-pole switch inside an appliance stays live. The app flags it: line and neutral swapped, appliances stay live when switched off. Swap them back.
A socket needs line, neutral and protective earth, each on its own terminal. Swapping line and neutral, or leaving the earth off, still lights a lamp, but it isn't safe. Try this exercise yourself, free and with no account, at wirewhy.com. The link is in the description.
A new socket in a kitchen, fed from a breaker of its own. Three conductors arrive in the box, the socket has three terminals, and it looks like the easiest job in an installation. It is also one of the most instructive, because a socket wired wrongly usually still works. Plug in a lamp and it lights whether line and neutral are swapped or the earth is left off. The mistakes only show when something else goes wrong, and then they matter a great deal.
This article explains what each terminal is for, why the earth and the polarity matter, how the circuit is protected, and how an electrician checks the result. You can wire the same socket yourself, with nothing at risk, in the free exercise Wiring a socket outlet. It is not a how-to for working on your own installation: that takes training, the right instruments, and in most countries a qualification.
The three terminals and their colours
A socket for a 230 V single-phase circuit has three terminals, usually marked on the back of the insert:
| Terminal | Conductor | Core colour (IEC, harmonized in Europe) | What it does |
|---|---|---|---|
| L | Line (phase) | Brown (black or grey are also line colours) | Brings the supply voltage, through the circuit's breaker |
| N | Neutral | Blue | Carries the working current back to the supply |
| PE (⏚) | Protective earth | Green-and-yellow | Carries no current in normal use; connects the appliance's metal case to earth |
L and N together are the working circuit: the current goes out on one and comes back on the other. PE is different. It is there for the moment something fails, and it goes to the socket's earthing pin or, on a Schuko-type socket, to the two earthing clips at the sides.
Older installations use other colours (for example red and black in the UK before 2004). Never trust a colour alone: an earlier repair may have used whatever wire was at hand. What a conductor is, is proved by measuring.
Why the earth matters
Many appliances, such as kettles, washing machines and toasters with metal bodies, are class I: they rely on the earth for safety. Their metal case is connected through the plug's earth contact to the socket's PE.
Imagine a loose line wire inside such an appliance touching the case. With the earth connected, the fault current flows through the case and the PE conductor back to the supply. It is large, so the breaker trips, or the RCD trips sooner still, and the circuit is disconnected within a fraction of a second. The installation standard (IEC 60364-4-41) sets that disconnection time for final circuits like this one: 0.4 s in a TN system at 230 V.
Without the earth, nothing trips. The case simply sits at the line voltage and waits. The next person to touch it while also touching a tap or a radiator becomes the path to earth. A missing earth is invisible in normal use, which is exactly why it is dangerous.
Class II appliances (marked with a double square) have no earth contact and do not need one, but a socket never knows what will be plugged into it, so the earth is always connected.
Polarity, and why it matters even with reversible plugs
Swap L and N and a socket still delivers 230 V between its two contacts, so everything plugged in works. The problem is what is now live when it should not be:
- an appliance with a single-pole switch or thermostat breaks the neutral instead of the line, so it is switched off but its insides stay live;
- a fuse inside an appliance sits in the neutral, so when it blows the appliance stays connected to the line;
- a lamp with an E27 screw holder plugged in can have its touchable thread live instead of its centre contact.
Some plugs, like the British BS 1363, fit only one way, so polarity at the socket decides polarity at the appliance. Others, like Schuko and the flat Euro plug, fit either way round, and appliances sold for those countries are designed to be safe with either polarity. Even there, the fixed installation must be right: the breaker and every switch must be in the line, and the next electrician will read L as line. Polarity is one of the standard checks on every new circuit; our article on measuring an installation explains how it is tested.
The breaker and the RCD
A socket circuit has two kinds of protection, and they do different jobs:
- The circuit breaker (MCB) protects the cable against overload and short circuit. It sits in the line only, which is why the line goes through it and the neutral and earth do not. A 16 A breaker on 2.5 mm² cable, as in the exercise, is common; the right size depends on the cable, how it is installed, and national rules. Our article on MCB trip curves B, C and D explains why it trips, and when it does not.
- The RCD protects people. It compares the current going out on the line with the current coming back on the neutral and trips at a small difference, typically 30 mA. IEC 60364-4-41 requires this additional protection for sockets up to 32 A that ordinary people use, so in practice every household socket circuit is behind a 30 mA RCD. How it works, and why it sometimes trips for no obvious reason, is in Why does my RCD trip?
A kitchen socket often gets a circuit of its own, as in the exercise: kettles, toasters and microwaves each draw several amps, and a fault there should not switch off the lights.
Wiring the socket, step by step
This is the reference answer in the exercise, and the order an electrician follows in the box:
- Line into the breaker. The supply's L goes to the breaker's line-in terminal.
- Breaker out to the socket's L. The breaker's line-out goes to the socket's L terminal.
- Neutral straight to N. The supply's neutral goes directly to the socket's N, without passing through the breaker.
- Earth straight to PE. The supply's protective earth goes directly to the socket's PE. The earth is never switched, never fused, and never interrupted by anything.

The exercise's reference answer: the line through the 16 A breaker to the socket's L, the neutral and the protective earth straight from the supply to N and PE. Check my work: every goal met.
In a real box, each conductor is stripped to the length marked on the socket, fully inserted, and tightened (or pushed home in a spring terminal) so no bare copper shows. The earth core is usually connected first and left slightly longer, so if the cable is ever pulled, it is the last to come off.
Testing the socket
A new or changed circuit is tested before it goes into use, first dead and then live (IEC 60364-6 sets out the checks):
With the circuit isolated:
- continuity of the protective conductor, from the main earthing terminal to the socket's PE, with a low-resistance tester;
- insulation resistance between the conductors and to earth, typically at 500 V DC, at least 1 MΩ for a 230 V circuit;
- polarity: the breaker and switches are in the line.
With the circuit live, at the socket:
| Between | Correct reading | A different reading suggests |
|---|---|---|
| L and N | about 230 V | 0 V: no line arrives, or the neutral is open |
| L and PE | about 230 V | Much less, or 0 V: the earth is missing or open |
| N and PE | close to 0 V | Around 230 V, while L–PE reads 0 V: line and neutral swapped |
Then come the earth fault loop impedance and the RCD test, both with an installation tester.
A plug-in socket tester with three lamps is handy for a quick check, but it cannot see everything: with neutral and earth swapped, or joined together at the socket, it shows "correct". Only the measurements above find those.
Classic mistakes, and what the simulator shows
| Mistake | What happens in real life | What WireWhy shows |
|---|---|---|
| Earth not connected | Everything works; a class I appliance with a fault has a live case and nothing trips | "Socket is live, but its earth terminal is not connected to earth." The goal fails. |
| L and N swapped | Everything works; appliances' single-pole switches and fuses end up in the neutral | "Socket has line and neutral swapped: appliances stay live when switched off." |
| N and PE swapped, or bridged at the socket | Works without an RCD, but the working current returns on the earth conductor and the appliance's case hangs on the neutral, which goes live if the neutral breaks. Behind an RCD, it trips as soon as current flows | The socket tester in Measure mode reads "Correct", as a real one would; put an RCD in front and plug in an appliance (the socket's setting), and the RCD trips |
| Line on the earth terminal | The appliance's case becomes live: the most dangerous of all | The socket tester reads "Line and earth reversed" |

Line and neutral swapped at the socket. A plugged-in lamp would still light, but WireWhy flags it: appliances stay live when switched off.
The N–PE bridge deserves a word. In some old two-core installations without an earth conductor, sockets were "earthed" by a link from N to the earthing pin. It works until the neutral breaks somewhere upstream; then the link puts the line voltage, through whatever is plugged in, on every case connected to it. A socket without an earth conductor stays unearthed and gets an RCD in front, or better, a new cable; it never gets a link to the neutral. Our article on earthing systems explains where neutral and earth may legitimately be joined, and why only there.
Safety first
Before anyone opens a socket:
- isolate the circuit at its breaker, and lock it off if you can;
- prove the tester on a known live source;
- test dead at the socket: L–N, L–PE and N–PE;
- prove the tester again.
A label in the board can be wrong, and a borrowed neutral can be live with the breaker off. If you are not trained, or the box shows scorch marks, aluminium wiring, no earth conductor, or anything you do not understand, call an electrician. In many countries fixed wiring work has to be done, or certified, by a qualified person anyway.
Try it yourself
The exercise Wiring a socket outlet is in the first unit of WireWhy's free course, First circuits, right after the one-way switched lamp, and takes about five minutes. Wire the supply, the B16 breaker and the socket, press Check my work, and switch to the realistic view to see the socket as it would be on the wall. Then try the mistakes: swap L and N, take the earth off, and read what What happened says. In Measure mode you can put the multimeter or the socket tester on the terminals and see each reading from the table above.
For the readings in more detail, see Measuring an electrical installation; for the device that protects the people using the socket, see Why does my RCD trip?
More from the same course: How to wire a light switch; Staircase timer wiring; Does a metal light fitting need earthing?.
Your turn
Wiring a socket outlet
Free, no account needed. It opens in the simulator.
Open the exercise →

