Quick Summary
An M12 connector is not a single product — it is a family of mechanically-keyed interfaces. The keyway machined into the male pin insert is what defines the "code": A code (sensor and actuator DC signal, 3/4/5-pin), B code (PROFIBUS-DP fieldbus, 3/5-pin), D code (Industrial Ethernet 100 Mbit, 4-pin shielded), X code (high-current power, 6/8-pin rated up to 16 A). Same M12 thread, different keying, completely different applications. This article decodes each of the four most-commonly-specified codes — what voltage they carry, what protocol they support, what IP rating they achieve, and which code matches which fieldbus protocol — so an OEM or ODM buyer can specify the right connector on the first RFQ rather than discovering the wrong code when the device is already on the production line.
Why M12 Coding Decides Whether Your Fieldbus Works at All
The M12 circular connector looks identical from the outside regardless of code. A 4-pin A-coded sensor connector and a 4-pin D-coded Industrial Ethernet connector share the same M12 thread, the same outer diameter, and the same coupling nut. If you tried to plug one into the other, however, the keying face would stop you. The flat pattern and the notch position machined into the male pin insert and the female socket insert are different for each code, and that mechanical difference is the entire point of the coding system.
The reason the coding exists is that industrial automation buses mix several different voltage and signal types in the same enclosure. A 24 V DC sensor signal, a 250 V AC actuator supply, a 100 Mbit Ethernet data line, and a 630 V / 16 A power line all coexist in the same panel. Without keying, an installer could plug a 24 V sensor into a 250 V actuator supply and destroy the sensor. With keying, the wrong plug physically cannot enter the wrong socket. The mechanical keyway is the last line of defence against electrical cross-wiring.
For OEM buyers, the practical consequence is that the connector specification on the bill of materials is not "M12 connector, 4-pin". It is "M12 A-coded 4-pin connector for sensor signal, IP67, 250 V AC, 4 A", or "M12 D-coded 4-pin connector for Industrial Ethernet, IP67, 30 V, 0.5 A per pair". The connector code is part of the specification, not an attribute of it.
The Common M12 Codes and What Each One Locks In
The IEC 61076-2 series defines the M12 connector family and the individual sub-standards for each code. The codes most commonly specified by OEM buyers are A, B, D, and X, with K, L, S, T, and Y codes appearing in more specialised applications. The four primary codes cover roughly 90% of industrial sensor, PROFIBUS, Industrial Ethernet, and DC power requirements.
Code A
- 3 / 4 / 5-pin (legacy 8-pin)
- Up to 250 V AC / 60 V DC
- Up to 4 A per pin
- DC sensors, solenoid valves, indicator lights
Code B
- 3 / 5-pin
- Up to 60 V AC / DC
- Up to 4 A per pin
- PROFIBUS-DP, RS-485 fieldbus
Code D
- 4-pin shielded
- 30 V AC / DC
- 0.5 A per pair
- PROFINET, EtherNet/IP, EtherCAT
Code X
- 6 / 8-pin
- 630 V AC / 60 V DC
- Up to 16 A per pin
- Power supplies, motor drives, PoE+
Outside this primary set, K and L codes address higher-current power and higher-speed Ethernet respectively. K code is mechanically similar to X but specified for 12 A continuous current. L code is the CAT6A variant for 1 Gbit and 10 Gbit Industrial Ethernet. S and T codes are variants for AC power that have superseded C code in many new installations. Y code covers another high-current power variant. For most OEM procurement decisions, A, B, D, and X cover the specification space; K, L, S, T, and Y are typically specified when the application demands one of the edge-case ratings.
Code A: Sensor and Actuator Signal, 3, 4 and 5 Pin
A code is the original M12 coding, defined for sensor and actuator DC signal applications in factory automation. The keyway geometry allows 3-pin, 4-pin, and 5-pin inserts in the same M12 housing, with the pin numbering fixed by the IEC standard so that any A-coded 4-pin connector from any supplier mates with any other A-coded 4-pin connector. A 3-pin A-coded sensor connector typically carries a single 24 V DC supply and a digital input or output; a 4-pin version adds a second channel or a diagnostic feedback line; a 5-pin version supports two independently-switched outputs or a power-and-communication combination.
The voltage and current ratings for A code are 250 V AC and 60 V DC maximum at 4 A per pin, which is comfortably above the 24 V DC, 0.5 A to 2 A that typical photoelectric, inductive, and capacitive sensors draw. The over-specification is intentional — it allows the same A-coded connector family to be used for the higher-power actuator applications such as solenoid valves, indicator lights, and small motor control relays that share the same cabinet.
The most common mistake when specifying A code is to assume that any 4-pin M12 connector will fit. A 4-pin D-coded Industrial Ethernet connector has the same M12 thread and the same number of pins but a different keyway. The two are not interchangeable. Buyers should always specify the code explicitly on the BOM, on the cable drawing, and on the connector datasheet, and should validate the keyway on the first sample shipment before committing to volume production.
Code B: PROFIBUS-DP Fieldbus, 3 and 5 Pin
B code was introduced when PROFIBUS-DP became the dominant fieldbus in European factory automation during the 1990s and early 2000s. The keyway geometry was designed to fit a 3-pin or 5-pin insert that carries the differential RS-485 signal pair, the shield termination, and the 5 V bus terminator supply. The voltage rating of 60 V AC/DC and current rating of 4 A per pin matches the requirements of PROFIBUS-DP nodes and segment couplers.
The 5-pin B code connector is the workhorse of PROFIBUS-DP installations. Two pins carry the differential data pair (typically Pin 3 and Pin 8 in the IEC convention), two pins carry the 5 V bus terminator power (Pin 6 and Pin 9), and one pin is dedicated to the cable shield. The shield pin is critical — without it, the PROFIBUS cable cannot meet the electromagnetic compatibility requirements of the IEC 61158-2 standard that PROFIBUS-DP follows.
For OEM buyers specifying a B-coded M12 connector for a PROFIBUS-DP node, the documentation packet should include the IEC 61076-2-101 compliance statement, the PROFIBUS connector profile certificate from PROFIBUS & PROFINET International (PI), and the cable shield termination drawing. A 5-pin B-coded connector that has not been PROFIBUS-profile-certified may pass a generic IEC compliance test but fail a PROFIBUS-DP signal-integrity test at the segment level. The PI connector profile is a separate certification that catches problems that generic IEC testing misses.
Code D: Industrial Ethernet 100 Mbit, 4 Pin Shielded
D code is the M12 coding for Industrial Ethernet, defined by the IEC 61076-2-101 amendment that aligned the M12 mechanical form factor with the 100 Base-TX Ethernet electrical specification in the IEEE 802.3 standard. The 4-pin D-coded connector carries two shielded twisted pairs — one pair for the transmit signal and one pair for the receive signal — and provides the 360-degree shield termination that industrial Ethernet installations require to meet the IEC 61784-4 noise-immunity targets for PROFINET, EtherNet/IP, and EtherCAT networks.
The voltage rating of 30 V and current rating of 0.5 A per pair reflects the Ethernet signal-level requirements, not a power-delivery requirement. Industrial Ethernet is data only; power is delivered separately or through Power-over-Ethernet (PoE) on the same conductors up to a 60W current limit. For installations that need both data and power, the D-coded connector carries both within the 0.5 A per pair rating, but the higher-power PoE+ and Type 3 / Type 4 PoE applications are migrating to the X-coded M12 connector described below.
D-coded M12 cordsets and panel-mount receptacles are the dominant physical layer for Industrial Ethernet in factory automation. The PROFINET specification references M12 D code as the standard field connector; EtherNet/IP follows the ODVA conventions that also specify M12 D code; EtherCAT and CC-Link IE Field both specify D-coded M12 for the field-device connection. The IEEE 802.3 Ethernet standard defines the electrical layer; the D-coded M12 connector is the mechanical interface that lets the field device plug into the network without damage to either side.
Code X: High-Current Power, 6 and 8 Pin, Up to 16 A
X code is the M12 coding for high-current power applications, introduced as the IEC 61076-2-111 amendment when Industrial Ethernet began migrating from low-power D-coded connectors to combined data-and-power architectures. The X-coded connector carries 8 pins (or 6 pins in the power-only variant) rated at 630 V AC and 60 V DC, with a continuous current rating of 16 A per pin. This is roughly an order of magnitude above the current capability of a D-coded Industrial Ethernet connector and is designed to deliver the full power that motor drives, PoE+ switches, and high-power field devices require.
The 8-pin X code is the variant specified for 10 Gbit Industrial Ethernet with Power-over-Ethernet, carrying four data pairs and four power pins in the same M12 connector. The mechanical keying is unique — X code shares the M12 thread but the keyway is offset differently from D code, so an X-coded plug cannot be inserted into a D-coded receptacle and vice versa. This protects the field installer from accidentally powering a data-only device with 16 A, or under-powering a motor drive with the 0.5 A that a D-coded connector can deliver.
For OEM buyers, X code is the right choice for three application families: power supplies to field devices (where the M12 X cordset replaces a heavier and bulkier M16 or M23 power cordset), motor drives and servomotor controllers that require both data and power through a single connector, and high-power PoE installations that exceed the current limit of D-coded PoE. The ODVA standards body has incorporated X-coded M12 into the EtherNet/IP physical layer for high-power applications, and the PROFINET specification references X code for combined data-and-power field devices.
Pin Count, IP Rating, and Coding Compatibility Decoder
The decoder below summarises the pin counts, voltage ratings, current ratings, and IP ratings for the four primary codes, plus the two secondary codes (K and L) that appear in higher-power and higher-speed applications.
| Code | Pin count | Voltage | Current per pin | Typical IP rating | Primary application |
|---|---|---|---|---|---|
| A | 3, 4, 5 (legacy 8) | 250 V AC / 60 V DC | 4 A | IP67 (mated) | DC sensors, solenoid valves, actuator signals |
| B | 3, 5 | 60 V AC / DC | 4 A | IP67 (mated) | PROFIBUS-DP, RS-485 fieldbus |
| D | 4 (shielded) | 30 V AC / DC | 0.5 A per pair | IP67 (mated) | Industrial Ethernet 100 Mbit (PROFINET, EtherNet/IP, EtherCAT) |
| X | 6, 8 | 630 V AC / 60 V DC | 16 A | IP67 (mated) | High-current power, motor drives, PoE+ |
| K | 2, 3, 4, 5 | 630 V AC | 12 A | IP67 (mated) | AC power (variant of X for AC applications) |
| L | 8 | 60 V DC | 0.5 A per pair | IP67 (mated) | Industrial Ethernet 1 Gbit / 10 Gbit, CAT6A |
The IP67 rating is the baseline for mated M12 connectors from most OEM suppliers. The rating means the connector is dust-tight and protected against temporary immersion in water up to 1 metre for up to 30 minutes. For outdoor, food-and-beverage, pharmaceutical, and marine applications, the IP68 rating (continuous immersion up to a specified depth and duration) and the IP69K rating (high-pressure, high-temperature jet cleaning) are commonly specified and are available from specialist suppliers. Ningbo Jguang's panel-mount waterproof connectors cover the IP55 to IP67 range across the M12/M16/M19/M25 thread sizes, with the IP67 mated rating being the workhorse for the OEM sensor and fieldbus markets.
Site Selection Quick Reference: Matching Code to Application
The matrix below maps the four primary codes to the eight most common industrial-automation application families. The matrix is not exhaustive, but it covers the specification decisions that an OEM procurement team encounters most frequently.
| Application | Recommended code | Rationale |
|---|---|---|
| Photoelectric / inductive / capacitive sensor, 24 V DC | A, 3-pin or 4-pin | DC sensor signal, low current |
| Solenoid valve or relay panel, 24 V DC | A, 4-pin | DC actuator signal, 4 A capability |
| PROFIBUS-DP node connection | B, 5-pin | RS-485 differential pair with shield termination |
| PROFINET field device, 100 Mbit | D, 4-pin shielded | Industrial Ethernet per IEC 61784-4 |
| EtherNet/IP node, 100 Mbit | D, 4-pin shielded | ODVA-conformant Industrial Ethernet |
| EtherCAT slave, 100 Mbit | D, 4-pin shielded | EtherCAT P supports D and X variants |
| Field-mounted motor drive, 400 V AC supply | X, 8-pin (4 data + 4 power) | Combined data and power up to 16 A |
| Outdoor solar tracker or wind turbine sensor, weather-exposed | A or D, IP67 + IP68 | Outdoor waterproof rating required |
| Food & beverage conveyor, daily washdown | A or D, IP67 + IP69K | High-pressure jet cleaning rating required |
The matrix illustrates the core decision logic. If the application is sensor or actuator signal below 60 V and a few amps, A code is correct. If the application is differential data bus at RS-485 levels, B code is the historical and PROFIBUS-specified choice. If the application is Industrial Ethernet at 100 Mbit, D code is universal. If the application is power above 0.5 A per pin or PoE above Type 2, X code is the correct choice. The matrix is a starting point; the cable drawings, the fieldbus protocol specifications, and the IEC 61076-2 compliance documentation are the binding requirements.
The Ningbo Jguang M12/M16/M19/M25 Waterproof Connector Range
Ningbo Jguang Industry Co., Ltd. supplies the full M12 coding range — A, B, D, X, and the secondary K and L codes — in panel-mount, overmoulded cordset, and field-wireable variants. The product line is centred on the 2-pin through 10-pin M12/M16/M19/M25 panel-mount waterproof circular connector family, which is supplied in the IP55 through IP67 rating range across the M12 to M25 thread sizes. The connector family is OEM/ODM-customisable for cable length, overmould material (PVC, PUR, TPE), pin count, code, and shielding termination.
The factory operates in-house tooling for the mould development, the contact machining, the insert moulding, and the overmould production — the full connector manufacturing chain from raw brass contact to finished overmoulded cordset. Buyers specifying a custom coding configuration or a non-standard pin count can request a mould-development quotation as part of the RFQ, with the production timeline built around the mould-delivery schedule. Standard catalogue items in the A and D codes are typically available on a 2-4 week production lead time, with custom configurations extending the timeline by an additional 4-8 weeks.
The certifications documented on the J-Guang certifications page include ISO 9001 quality management, UL listing for the North American market, CE marking for the European market, and RoHS compliance for the restriction of hazardous substances. Buyers specifying connectors for the European market should request the CE Declaration of Conformity and the RoHS test report; buyers specifying for North America should request the UL listing letter with the file number. The M12 connector family is supplied with documentation packets that include the IEC 61076-2 compliance statement, the material declaration, and the dimensional drawing per the supplier's quality management system.
For OEM buyers evaluating the full M12 connector range across multiple coding families, the J-Guang connector product centre documents the panel-mount, cordset, and field-wireable variants with the pin count, code, voltage, current, and IP rating tables. The site serves as the catalogue reference for RFQ preparation; pricing, lead time, and OEM/ODM terms are handled through direct quotation via the sales team at sara@nbjguang.com.
How to Specify the Right M12 Code on the First RFQ
Three specifications determine the code: the bus protocol (sensor signal = A, PROFIBUS = B, Industrial Ethernet = D, high-current power = X), the pin count (3, 4, 5, 6, or 8 within the code's IEC-defined envelope), and the IP rating (IP67 baseline, IP68 for outdoor immersion, IP69K for washdown). Once those three are locked, the BOM line item reads "M12 [code]-coded, [n]-pin, IP[xx], [voltage]/[current], [termination]". Ningbo Jguang's sales team responds to RFQ with the code-specific datasheet, the IEC 61076-2 compliance statement, and the lead-time quotation within the standard RFQ turnaround.
Frequently Asked Questions
What does the M12 connector 'code' actually lock in?
The M12 coding is a keyway machined into the male pin insert and the matching female socket insert. Each code defines a specific pattern of flats and notches around the keying face so that, for example, an A-coded connector cannot be mated with a B-coded, D-coded, or X-coded connector — even if all four share the same M12 thread and outer diameter. This mechanical keying protects the circuit from being plugged into a wrong voltage, the wrong signal type, or the wrong bus polarity.
How many M12 codes are there?
The IEC 61076-2 series defines at least eight codes commonly used in industrial automation: A (sensor and actuator signal), B (PROFIBUS-DP fieldbus), C (AC power, increasingly replaced by S code), D (Industrial Ethernet 100 Mbit, 4-pin shielded), K (power, similar to X), L (CAT6A high-speed Ethernet), T (power, similar to S), X (high-current power, 8-pin), and Y (another power variant). The four codes most commonly specified by OEM buyers — A, B, D, and X — cover the majority of sensor, fieldbus, Industrial Ethernet, and DC power applications.
What is the difference between A-code and B-code M12 connectors?
A code and B code share the same M12 mechanical thread but have different keyway geometry. A code is used for sensor and actuator DC signals, typically 3-pin, 4-pin, or 5-pin at low DC voltages up to 250 V. B code is used for PROFIBUS-DP fieldbus, typically 3-pin or 5-pin at 60 V AC/DC. The mechanical difference matters because a 5-pin A-coded sensor connector cannot be mated with a 5-pin B-coded PROFIBUS connector — they look similar but the keying prevents it.
Can a D-coded M12 connector do 1 Gbit Ethernet?
No. D code is rated for 100 Mbit / 100 Base-TX Industrial Ethernet only. For 1 Gbit, 10 Gbit, or CAT6A performance, the L-coded or X-coded M12 connector is required, with shielding that supports higher frequencies. The IEEE 802.3 standard defines the electrical characteristics; the IEC M12 connector code defines the mechanical form.
What does M12 X code mean?
M12 X code is the IEC-defined high-current power connector, typically 6-pin or 8-pin, rated at 630 V AC / 60 V DC and 16 A continuous current per pin, designed for power supplies to field devices, motor drives, and PoE applications that exceed the current capability of an A-coded or D-coded connector. X code is the correct choice when the load requires more current than a D-coded Industrial Ethernet line can deliver over Power-over-Ethernet.
What IP rating do M12 connectors typically achieve?
Most M12 connectors are rated to IP67 when mated — meaning dust-tight and protected against temporary immersion in water up to 1 metre for up to 30 minutes. Higher-rated versions, including IP68 (continuous immersion) and IP69K (high-pressure, high-temperature jet cleaning) are available from specialist suppliers and are commonly specified for food-and-beverage, pharmaceutical, and outdoor applications.
Can a Chinese OEM supply the full A, B, D, X code range?
Yes, established Ningbo-based connector manufacturers such as Ningbo Jguang Industry Co., Ltd offer OEM/ODM production across the full A, B, D, and X code range with custom mould development for panel-mount, overmoulded cordset, and field-wireable variants. Buyers should request IEC 61076-2 compliance documentation, UL listing (where North American certification is required), and CE / RoHS declarations before shipment.
How do I match an M12 connector to a fieldbus protocol?
The matching is defined by the protocol standards body. PROFIBUS-DP and PROFINET specify M12 B code and D code respectively. EtherNet/IP and EtherCAT follow ODVA conventions for M12 D code. CC-Link IE Field specifies M12 X code for power and D code for data. The IEEE 802.3 Ethernet standard defines the electrical layer; the connector code is the mechanical interface that lets the field device plug in without damage to either side.
