If you’ve ever ordered an M12 connector and received something that physically won’t mate with your device, you’ve run into a coding mismatch. M12 coding is the keyway system that prevents wrong connectors from being plugged together — but with 11 coding types in use today, choosing the right one is far from obvious.
This guide explains every M12 coding type, what it’s used for, and how to pick the right one for your application in under five minutes.
What Is M12 Connector Coding?
M12 coding refers to the physical notch (keyway) position on the connector body. Different coding types have their keyways in different positions, which means only matching plugs and sockets can mate. This prevents, for example, an Ethernet connector from being accidentally connected to a power port.
Coding does not determine electrical performance on its own — that depends on pin count, contact rating, and shielding. But coding is the first filter in correct connector selection.
M12 Coding Types at a Glance
| Coding | Typical Use | Pin Count | Max Current/Voltage |
|---|---|---|---|
| A | Sensors, actuators, DC power | 3, 4, 5, 8, 12, 17 | 4A / 60V |
| B | Fieldbus (PROFIBUS, DeviceNet) | 5 | 4A / 60V |
| D | 100 Mbps Industrial Ethernet | 4 | — |
| X | Gigabit / 10 Gbps Ethernet | 8 | — |
| S | AC power (IEC 61076-2-111) | 4, 5 | 12A / 630V |
| T | DC power (IEC 61076-2-111) | 4, 5 | 12A / 63V |
| K | High-current AC power | 6 | 16A / 630V |
| L | High-current DC power | 4, 5 | 16A / 63V |
| M | High-current power | 4, 5 | 16A / 630V |
| Y | Sensors (compact variant) | 2, 3, 4 | 4A / 60V |
| C | Audio/legacy | 6 | — |
The 5 Codings You’ll Use Most
A-Coded M12 — The Universal Workhorse
A-coded is the most common M12 connector in industrial automation. It handles sensor and actuator signals, DC power distribution, and general I/O connections. If a device spec sheet simply says “M12 connector” without specifying coding, it is almost certainly A-coded.
Use A-coded when:
- Connecting proximity sensors, photoelectric sensors, or limit switches
- Wiring actuators or valve manifolds
- General 24V DC power and signal applications
Pin assignment (5-pin, most common):
- Pin 1: +24V DC (Brown)
- Pin 2: Signal / I/O (White)
- Pin 3: GND (Blue)
- Pin 4: Signal / I/O (Black)
- Pin 5: Shield (Grey)
B-Coded M12 — Fieldbus Connections
B-coded connectors are the standard for PROFIBUS DP and DeviceNet fieldbus networks. The 5-pin configuration is almost universal in this application.
Use B-coded when:
- Connecting field devices on PROFIBUS DP networks
- Working with DeviceNet or other legacy fieldbus topologies
Note: B-coded connectors look similar to A-coded from a distance. Always verify the keyway position before ordering — mismating attempts can bend pins.
D-Coded M12 — Industrial Ethernet at 100 Mbps
D-coded connectors are the standard physical interface for 100 Mbps industrial Ethernet protocols including PROFINET, EtherNet/IP, and EtherCAT. They use a 4-pin configuration paired with Cat5e industrial cable.
Use D-coded when:
- Deploying PROFINET, EtherNet/IP, or EtherCAT at field level
- Connecting PLCs, I/O modules, drives, and sensors on a 100 Mbps network
- Replacing legacy fieldbus with industrial Ethernet
Pin assignment (4-pin):
- Pin 1: TX+ (Yellow)
- Pin 2: RX+ (White/Orange)
- Pin 3: TX– (Orange)
- Pin 4: RX– (White/Blue)
X-Coded M12 — Gigabit and 10 Gbps Industrial Ethernet
X-coded connectors support 1 Gbps and 10 Gbps Ethernet, making them the right choice for machine vision systems, IIoT backbone networks, edge computing nodes, and high-speed data acquisition.
The X in the name refers to the X-shaped galvanic isolation plate inside the connector that separates the four wire pairs — a visible identifier in the field.
Use X-coded when:
- Transmitting large data volumes (machine vision, high-resolution sensing)
- Building IIoT or Industry 4.0 backbone infrastructure
- Requiring Cat6A performance in an IP67-rated connector
Key spec: X-coded M12 with Cat6A cable supports 10GBASE-T up to 40 meters in industrial environments.
S-Coded and T-Coded M12 — Power Connectors
S-coded handles AC power; T-coded handles DC power. Both are defined under IEC 61076-2-111 and are designed for the growing use of M12 connectors in distributed power delivery — replacing traditional terminal blocks in many installations.
Use S-coded when: Distributing AC power to field devices, machine lighting, or heating elements
Use T-coded when: Distributing 24–48V DC power across sensors, actuators, or I/O blocks
Advantage over terminal blocks: S/T-coded M12 power connectors are tool-free, IP67-rated, and allow hot-swap capability in modular machine architectures.

Common Selection Mistakes
Mistake 1: Ordering A-coded when you need D-coded for Ethernet
A-coded and D-coded connectors look similar. Always check whether your device requires standard I/O or Ethernet connectivity before ordering.
Mistake 2: Using D-coded for Gigabit applications
D-coded connectors are electrically limited to 100 Mbps. Forcing Gigabit signals through a D-coded connector causes signal integrity failures. Use X-coded for anything above 100 Mbps.
Mistake 3: Ignoring shielding requirements
In environments with variable frequency drives or heavy motor loads, unshielded M12 cables will introduce noise into Ethernet or sensor signals. Always specify shielded cables and verify that connector shells are grounded.
Mistake 4: Assuming IP67 is sufficient for all washdown applications
IP67 covers temporary immersion. If your equipment undergoes high-pressure steam cleaning (common in food processing), specify IP69K connectors instead.
Quick Selection Checklist
Before specifying any M12 connector, confirm these six parameters:
- Coding type — based on protocol or application above
- Pin count — match to device specification
- Cable exit direction — straight or 90-degree angled
- IP rating — IP67 standard, IP69K for washdown
- Shielding — required for Ethernet and noise-sensitive signals
- Mating side — plug (male pins) or socket (female contacts)

Frequently Asked Questions
What is the difference between M12 A-coded and D-coded connectors?
A-coded M12 connectors are used for sensors, actuators, and general 24V DC signals, with 3 to 17 pins. D-coded M12 connectors are specifically designed for 100 Mbps industrial Ethernet (PROFINET, EtherNet/IP, EtherCAT) and use a 4-pin configuration. The keyway positions are different, so they cannot be mismated.
Can I use an M12 D-coded connector for Gigabit Ethernet?
No. D-coded M12 connectors support a maximum data rate of 100 Mbps (Fast Ethernet). For Gigabit (1 Gbps) or 10 Gbps applications, you must use X-coded M12 connectors with Cat6A cable.
What M12 coding does PROFINET use?
PROFINET uses D-coded M12 connectors at 100 Mbps (the most common field-level deployment). Some high-performance PROFINET applications using Gigabit infrastructure use X-coded connectors.
What is the difference between M12 S-coded and T-coded power connectors?
S-coded M12 connectors are designed for AC power distribution (up to 630V, 12A). T-coded M12 connectors are designed for DC power distribution (up to 63V, 12A). Both are defined under IEC 61076-2-111. The different codings prevent AC and DC power connectors from being mismated.
How do I identify M12 connector coding in the field?
Look at the keyway notch on the connector face. The position of the notch corresponds to the coding type. A-coded has the notch at the top; D-coded has a narrower notch at roughly the 2 o’clock position; X-coded has an X-shaped internal divider visible through the face. When in doubt, refer to the device datasheet.
Looking for M12 connectors in A, B, D, or X coding with IP67 or IP69K ratings? Contact our engineering team for selection support and samples.



