
We had a drawing on our desk last month that just said "M12 connector." No code, no pin count, nothing about where it was going. That one line could mean a cheap 3-pin sensor plug or a 10-gigabit Ethernet link, and those two parts won't go anywhere near each other. M12 isn't a single connector. It's a whole family that happens to share a thread. This page walks through how we narrow it down.
First, M12 is just the thread
M12 means a 12 mm threaded coupling, usually M12x1. That's it. It says nothing about what's inside or what the connector actually does. Everything that matters lives in the code stamped near the threads. Get the code wrong and the plug won't seat, even though the nut screws in fine. We see that one a lot. Someone orders by thread size and assumes the rest will sort itself out.
The code is the first thing to pin down
There are five codes you'll actually run into. A, B, C and D sit under IEC 61076-2-101 and 61076-2-109, and X-code handles the fastest Ethernet. They all use the same M12x1 thread, but the keying is cut differently so a wrong-code plug physically can't mate. That's deliberate. Here's the map we use when a part number is vague:
| Code | Standard | What it's for | Typical pins | Heads up |
|---|---|---|---|---|
| A-code | IEC 61076-2-101 | Sensors, actuators, general I/O | 3, 4, 5, 8 | The one you'll see most, often rated around 4A |
| B-code | IEC 61076-2-101 | Profibus fieldbus | 5 | Keyed differently from A, won't mate |
| C-code | IEC 61076-2-101 | AC power | 3, 4, 5 | Power contacts, not for signal |
| D-code | IEC 61076-2-109 | Industrial Ethernet, 100 Mbps to 1 Gbps | 4 | Looks like A, keyed for PROFINET and EtherCAT |
| X-code | IEC 61076-2-109 | 10 Gbps Ethernet, Cat6a and up | 8 | High-speed data, 8 contacts |
A few of these look identical from the outside. A-code and D-code are the classic mix-up. Both come in a 4-pin version, both use the same thread, but the key is rotated so you can't force one into the other. If your drawing only says "4-pin M12," ask which code before you place the order. That one question saves a lot of returned goods.
How many pins, and what for
Pin count follows the job. A simple PNP or NPN sensor gets by with 3 pins: power, signal, ground. Add a second output or a diagnostic line and you're at 4 or 5. Eight pins show up on A-code blocks that bundle several signals, and on X-code Ethernet. Then there are the odd ones, 12-pin and 17-pin versions for gear that needs more than the usual handful of conductors. We keep the common 3, 4, 5 and 8-pin parts on the shelf and tool the unusual counts when the volume justifies it.
IP67, IP68 and IP69K are not the same
IP67 means it can take a temporary dunk, about 1 m for half an hour. IP68 is for sitting in water longer and deeper, and the exact depth should be on the datasheet rather than guessed. IP69K is a different animal, rated for high-pressure, high-temperature washdown, the kind you get in food plants and car washes. Pick the rating for where the connector actually lives. An IP67 part on a hose-down line won't last, and paying for IP69K on a dry control cabinet is money you don't need to spend.
Panel mount or molded cable
You'll choose two things here: where the connector sits and how the wire ends. A panel-mount receptacle bolts through the enclosure and you solder or crimp the back. A molded cable assembly arrives with the cable already overmolded, which is faster to fit and seals better. For terminations you've got solder, crimp, screw and IDC, each with its own trade-off. Solder is solid for a board, crimp is quick in production, screw is easy to rework in the field, and IDC skips the stripping step. Tell us how the part gets installed and we'll point you at the right one.
Factory-direct M12, without the catalog markup
Named-brand M12 parts are easy to spec and painful to buy in volume. The lead times stretch, the minimums climb, and you end up paying for a label as much as a connector. We make A-code, B-code and D-code M12 connectors in Shenzhen, panel-mount and molded cable both, and we hold the usual pin counts in stock. Same code, same keying, same IP rating, but factory-direct pricing, lower MOQs and lead times counted in days instead of quarters. Send us the drawing that started this and we'll quote the match.
What to send for a quote
Four things is all we need: the code, the pin count, panel-mount or cable and how long, and where it's going so we can confirm the IP rating. If you've got a full part number, even better. We'll cross-check it against our tooling and get back to you the same day.
FAQ
Can an A-code M12 plug into a D-code socket?
No. Same thread, different key. They won't mate, and that's on purpose.
Is M12 the same thing as M8?
No. M12 is the bigger one. M8 is smaller. If you're not sure which you've got, check our M8 vs M12 guide.
What pin count do I need for a sensor?
Most sensors use 3 or 4 pins. D-code Ethernet is 4-pin too, but a different code.
Is IP68 better than IP67?
For water, yes. IP68 takes longer immersion. IP69K is for high-pressure washdown.
Do you make drop-in M12 parts?
We do. Send the code, pin count and cable length and we'll quote you the match.




