M12 Connector Types: A, B, D, X Coding Explained
M12 connector types and coding explained: compare A, B, C, D, K, T and X coding, their pin counts, protocols and applications, and how to choose the right one.
A 40-second visual guide to A · B · D · X coding.
M12 Connector Types: A, B, D, X Coding Explained
Quick AnswerOn this page
Quick Answer
M12 connector types are distinguished by their coding — the keyed shape of the insert that determines what the connector can mate with and what it carries. The main M12 connector types are A-coded (sensors and I/O), B-coded (PROFIBUS), D-coded (100 Mbit Ethernet), and X-coded (10 Gigabit Ethernet), plus C-, K- and T-coding for power. Each coding supports specific pin counts and a specific electrical role, so choosing the coding is really choosing the connector's job.
What Is Connector Coding?
Before comparing the individual M12 connector types, it helps to understand what "coding" actually means. Coding refers to the keyed geometry of the insulating insert that holds the contacts. Each coding has a distinct shape — different notches, ribs and contact arrangements — so a connector of one coding can only mate with a socket of the same coding.
This keying is a safety and reliability feature, not just a label. Because an A-coded plug physically cannot enter a D-coded or B-coded port, it is impossible to accidentally plug a power or fieldbus cable into a sensor input, or to cross a 100 Mbit Ethernet link into a 10 Gigabit port. On a machine with dozens of identical-looking 12 mm connectors, that mechanical protection prevents expensive miswiring and equipment damage during installation and maintenance.
Coding also signals intent. Each coding has evolved for a particular electrical role — low-current signals, fieldbus, industrial Ethernet at different speeds, or power — and each supports only the pin counts that suit that role. As a result, the same 12 mm M12 body can be specialised into very different connectors simply by changing the coding. The coding, the pin count and the pinout together define exactly what a given M12 connector does, which is why selecting the right coding is the first and most important step in specifying any M12 connection.
All of these types share the M12 form factor and the IEC 61076-2-101 family of standards, so within a coding, parts from different manufacturers interoperate. That interoperability is a major reason the M12 has spread across the automation industry: an engineer can specify "5-pin B-coded" or "4-pin D-coded" and be confident the part will mate with equipment from any compliant supplier. For background on the M12 form factor itself, see our guide to what an M12 connector is.
Coding Comparison
The table below summarises every common M12 coding, its available pin counts and its typical applications. Read it as a quick map, then jump to the detailed sections for the codings you care about.
| Coding | Name | Pin counts | Typical applications |
|---|---|---|---|
| A | A-Coded | 3, 4, 5, 8, 12, 17 | Proximity sensors, Photoelectric sensors, General I/O |
| B | B-Coded | 5 | PROFIBUS DP, Fieldbus |
| C | C-Coded | 6 | AC power |
| D | D-Coded | 4 | PROFINET, EtherNet/IP, 100Base-TX |
| K | K-Coded | 6, 8 | AC/DC power distribution |
| T | T-Coded | 4, 5 | DC power, Motor connections |
| X | X-Coded | 8 | 10GbE, EtherCAT, High-speed Ethernet |
A useful way to read the table is by role. A-coding is the general-purpose signal type; B-coding is the legacy fieldbus type; D- and X-coding are the two Ethernet types, separated by speed; and C-, T- and K-coding are the power types. Almost every M12 selection decision starts by placing your connection into one of those four roles.
A-Coded
A-coded connectors are by far the most common M12 connector type. They are the default choice for sensors, actuators and general I/O, and they account for the majority of M12 connections in a typical plant. A-coding is available across the widest range of pin counts — 3, 4, 5, 8, 12 and 17 — so the same coding scales from a simple two-wire sensor up to a high-density multi-channel device.
In practice, a 3- or 4-pin A-coded connector handles two- and three-wire proximity and photoelectric sensors, where the contacts carry the supply voltage and one or two switching outputs. A 5-pin version adds a contact for an extra signal, an analogue output, or a functional earth, which is why it appears so often on devices that combine I/O with diagnostics. Higher pin counts — 8, 12 and 17 — serve encoders, multi-signal sensors, valve manifolds and complex actuators that need many conductors in a single coupling.
A-coded connections carry low-current DC signals and sensor supply, not power distribution or high-speed data. As pin counts climb, the individual contacts get smaller, so the current per contact falls; this is one more reason to check the rating of the specific part rather than assuming a family maximum.
Because A-coding is so widespread and standardised, off-the-shelf cordsets are stocked everywhere, in straight and angled bodies, field-wireable and pre-moulded. That keeps cost low and makes maintenance fast: a failed sensor lead is swapped for a stock equivalent in seconds. If you are connecting a sensor or general I/O point and no protocol mandates a different coding, A-coding is almost always the right answer. For a direct comparison with the fieldbus type, see A-coded vs B-coded.
B-Coded
B-coded connectors are the established M12 interface for PROFIBUS, the long-running industrial fieldbus. B-coding is typically 5-pin, and its keying is deliberately different from A-coding so a fieldbus cable can never be plugged into a sensor port and vice versa — an important safeguard, because the two are easy to confuse by eye.
PROFIBUS DP uses the B-coded connector to carry the differential data pair plus the shielding and reference connections that reliable fieldbus communication needs. The coding and pinout are tuned for that role, and the screened, sealed M12 housing keeps the bus running in electrically noisy, wet or vibrating environments where a standard fieldbus connector would struggle.
Where an installation still runs PROFIBUS — and many do, especially in process automation and established production lines — B-coded M12 connectors remain the correct and expected choice. For new networks, the Ethernet-based D- and X-coded types below have largely taken over the data-communication role, but B-coding endures wherever PROFIBUS is in service, and spares remain widely available. If you are extending or maintaining a PROFIBUS segment, specify B-coding to match the existing infrastructure.
In mixed plants it is common to find B-coding and the Ethernet codings side by side, as lines are modernised in stages rather than all at once. The keyed codings make that coexistence safe: even with PROFIBUS and PROFINET cabling running through the same machine, the connectors cannot be cross-mated, so a technician cannot accidentally patch a fieldbus lead into an Ethernet port during maintenance.
D-Coded
D-coded connectors brought industrial Ethernet to the M12 form factor. A D-coded connector is 4-pin and designed for 100 Mbit (Fast Ethernet) industrial protocols, most importantly PROFINET and EtherNet/IP. Its four contacts carry the two transmit and receive pairs of 100BASE-TX Ethernet, the same physical layer used by office Ethernet but packaged in a rugged, sealed, locking connector.
D-coding became the standard way to run Ethernet out to sensors, drives, cameras and remote I/O on the factory floor, combining familiar Ethernet networking with M12 ruggedness and IP-rated sealing. For a decade of automation build-outs it has been the default networking coding, and it remains the right choice wherever 100 Mbit is sufficient — which covers a very large share of field devices.
It is important to remember that a 4-pin D-coded connector and a 4-pin A-coded connector are not interchangeable: the keying is different, the pinout is different, and the signals are different. Plugging the wrong one in is exactly what the coding system is designed to prevent. If your device specifies PROFINET or EtherNet/IP at 100 Mbit, it expects D-coding. When you need more than 100 Mbit, step up to X-coding, described next.
X-Coded
X-coded connectors are the high-speed M12 connector type. An X-coded connector is 8-pin, with the contacts arranged in four shielded pairs, and it supports Ethernet up to 10 Gigabit. This makes it the choice for high-bandwidth industrial networks, including 1 and 10 Gigabit Ethernet backbones and demanding protocols such as EtherCAT.
The internal shielding between the four pairs is what allows X-coding to carry such high data rates while keeping crosstalk under control in electrically noisy environments. That is the key structural difference from D-coding: where D-coding's four contacts handle a single 100 Mbit link, X-coding's eight shielded contacts handle four pairs at far higher frequency. The result is a connector that brings data-centre-class bandwidth out to the machine in a sealed, locking M12 housing.
As machine vision, high-resolution sensing, and converged IT/OT networks push more data to the edge, X-coding is increasingly specified where D-coding's 100 Mbit is no longer enough. New high-performance cameras, drives and switches frequently standardise on it. If a device or network calls for Gigabit or 10 Gigabit Ethernet over M12, it will use X-coding.
Because X-coding runs at high frequency, the cabling matters as much as the connector. To actually reach Gigabit or 10 Gigabit speeds, the cordset must use properly shielded, category-rated cable and the connection must preserve the four-pair shielding end to end. Pairing an X-coded connector with under-specified cable will not deliver the rated bandwidth, so specify the connector and the cable as a matched assembly for high-speed links.
You can see the exact contact layout for D- and X-coded Ethernet connectors, and for the A-coded signal types, in our interactive Pinout Viewer, which shows male and female views and lets you highlight individual contacts.
Power Codings
Alongside the signal and network codings, the M12 family includes dedicated power codings so the same 12 mm form factor can also distribute supply voltages. Keeping power on its own keyed codings is essential: it ensures a power connector can never be mated with a signal or network port, so the higher voltages and currents stay safely isolated from sensitive I/O.
T-coding is the main DC power coding, commonly a 4-contact connector rated to about 63 V DC and 12 A. It carries DC supply and motor current, and on modern machines is a frequent choice for feeding DC power to drives, I/O blocks and remote devices.
K-coding is an AC power coding for higher-current AC distribution — typically a 4+PE (5-contact) connector rated up to about 630 V AC and 16 A, suited to three-phase AC supply where an S-coded connector runs out of headroom.
C-coding is an older AC coding (sometimes called "Micro-AC"), used for AC actuators and sensors with 3 to 6 contacts and a double keyway for safety; it is less common on modern designs than the other power codings.
Two further power codings complete the picture: S-coding for general AC mains (typically 3+PE, up to ~630 V AC) and L-coding for DC power in the PROFINET profile (4+PE, up to ~16 A). For the full breakdown of all five power codings — AC vs DC, ratings, pin counts and how to choose — see the M12 power connector guide.
The advantage of the power codings, taken together, is consistency: a machine can be wired for signals, networks and power using one connector family. That simplifies design, panel layout, ordering and spare-parts stock, while the coding system guarantees the right cable always goes to the right port.
M12 Coding and Industrial Protocols
One of the quickest ways to pick an M12 connector type is to start from the protocol or electrical standard you are using, because most of them map directly to a coding.
For fieldbus, PROFIBUS DP uses B-coding. For 100 Mbit industrial Ethernet, both PROFINET and EtherNet/IP use D-coding, which carries the two pairs of 100BASE-TX. When the network moves to Gigabit or 10 Gigabit Ethernet, the coding changes to X-coding, whose four shielded pairs provide the bandwidth and noise immunity those speeds require. High-performance and time-critical networks such as EtherCAT are likewise carried on X-coding where the extra bandwidth is needed.
On the signal side, ordinary sensors, actuators and general I/O — including IO-Link devices and discrete and analogue I/O — use A-coding, the general-purpose signal type. CAN-based networks such as CANopen and DeviceNet also run on the 5-pin A-coded connector; see the CAN bus pinout guide for that assignment. On the power side, AC supply uses C-coding, DC supply and motor power use T-coding, and heavier AC/DC power distribution uses K-coding.
Reading this mapping in reverse is just as useful during design: if you know a device must speak PROFINET, you already know it needs a 4-pin D-coded port; if it must carry 10 Gigabit Ethernet, it needs an 8-pin X-coded port. Anchoring the connector choice to the protocol removes most of the ambiguity from selection, and it ensures the connector, the cabling and the network equipment all agree.
Coding, Pin Count and Pinout
An M12 connector type is fully defined by three things together: its coding, its pin count, and its pinout. The coding sets the role and what it can mate with; the pin count sets how many conductors it carries; and the pinout sets which signal sits on which contact. Change any one of them and you have a different connector.
This is why pin count alone never identifies a connector. A 4-pin A-coded sensor connector and a 4-pin D-coded Ethernet connector share a pin count but nothing else — different keying, different pinout, different signals. Likewise, an 8-pin A-coded I/O connector and an 8-pin X-coded Ethernet connector are entirely different parts that happen to have the same number of contacts. When you order or wire an M12 connector, always specify all three: coding, pin count, and the standard pinout for that combination.
The pinout also depends on gender. The male and female versions of the same coding and pin count are mirror images of each other, so a contact that sits top-left on a plug is not in the same place on the socket. Getting this wrong is a classic cause of a link that simply will not come up. Our Pinout Viewer shows the exact assignment for each coding and pin count and lets you flip between male and female views, and the M12 connector pinout guide explains how to read each one — both help you avoid the mistake before you crimp or order.
Common Mistakes When Choosing a Coding
A few recurring errors account for most coding-related problems in the field, and all are easy to avoid once you know them.
The first is confusing two types that share a pin count — for example treating a 4-pin D-coded Ethernet port as if it were a 4-pin A-coded sensor port. The keying will block the physical mate, but ordering the wrong cordset still wastes time and money and delays commissioning.
The second is specifying the wrong Ethernet coding for the speed: using D-coding where the device actually needs Gigabit or 10 Gigabit Ethernet, which requires X-coding. Always check the network speed the device demands, not just that it is "Ethernet".
The third is overlooking the power codings and trying to push significant current through a signal coding. Power belongs on C-, T- or K-coding, which are designed and rated for it; A-coding is not, and using it for power risks overheating and contact damage.
The fourth is ignoring the documented requirement on the mating device. The device datasheet almost always states the coding it expects — following it guarantees both electrical and mechanical compatibility and removes the guesswork entirely.
M12 Connectors by Coding
Here are the M12 connectors in our range, grouped by coding. Select a part to see its details, or request a quote for codings we can supply on a custom basis.
A · A-Coded
B · B-Coded
C · C-Coded
D · D-Coded
K · K-Coded
T · T-Coded
X · X-Coded
How to Choose a Coding
Choosing among the M12 connector types is mostly a matter of matching the coding to the job, in a clear order.
First, identify the electrical role: is the connection a sensor or general I/O signal, a fieldbus, an Ethernet network, or power? That single question usually picks the coding. Signals and I/O point to A-coding. PROFIBUS points to B-coding. 100 Mbit Ethernet such as PROFINET and EtherNet/IP points to D-coding. Gigabit and 10 Gigabit Ethernet, and EtherCAT, point to X-coding. AC power points to C-coding, DC power to T-coding, and higher-current AC/DC power to K-coding.
Second, let the device or protocol decide for you where it can. Most automation devices specify the coding they expect, and matching it also guarantees mechanical compatibility, so there is no need to second-guess a documented requirement. When you are designing the device end yourself, pick the coding that matches the network or power standard you are implementing.
Third, choose the pin count within that coding to suit the number of signals or conductors, then confirm the electrical ratings — current and voltage — against your load, paying particular attention to the power codings where current headroom matters most. Finally, settle the mechanical details: gender, mounting style, straight or angled body, and pre-moulded versus field-wireable.
Worked through in this order — role first, then the device requirement, then pin count, ratings and mechanics — coding selection is fast and reliable, and it leaves little room for the mistakes covered above. The coding decision cascades into everything else, so getting it right at the start keeps the rest of the specification straightforward.
If you would rather filter the full catalogue directly, our connector selector lets you narrow parts by application, protocol, pin count and IP rating, and you can request a quote on any result. For sealing and protection levels across these types, see the IP rating guide, and for the M12 form factor in general, the what is an M12 connector guide.
Frequently asked questions
- What are the different M12 connector coding types?
- The common M12 coding types are A, B, C, D, K, T and X. A is for sensors and general I/O, B for PROFIBUS, C for AC power, D for 100 Mbit industrial Ethernet, K and T for power, and X for 10 Gigabit Ethernet. Each coding has a keyed insert so only matching types can mate.
- What is the difference between A-coded and D-coded M12 connectors?
- A-coded M12 connectors carry sensor signals, actuator drive and general I/O, usually in 3-, 4- or 5-pin form. D-coded connectors are 4-pin and designed for 100 Mbit industrial Ethernet such as PROFINET and EtherNet/IP. The keying differs so the two cannot be mated together, and their pinouts are completely different.
- Which M12 coding is used for PROFINET?
- PROFINET at 100 Mbit uses D-coded M12 connectors. For higher-bandwidth networks up to 10 Gigabit Ethernet, including some EtherCAT installations, X-coded M12 connectors are used instead.
- Can I mate different M12 coding types together?
- No. Each coding has a uniquely keyed insulating insert, so an A-coded connector cannot be mated with a B- or D-coded one. This is intentional: it mechanically prevents miswiring, for example stopping a power or fieldbus cable from being plugged into a signal port.
- Which M12 coding is used for Ethernet?
- D-coded M12 connectors are used for 100 Mbit industrial Ethernet (PROFINET, EtherNet/IP). X-coded connectors are used for higher-speed Ethernet up to 10 Gigabit, and for protocols such as EtherCAT that need the extra bandwidth.
Find the right M12 coding for your project
Use our selector to filter by coding, protocol and pin count, or send us your requirements for a quote.