M12 Connector Coding Explained: A-Coded, D-Coded, X-Coded and More
If you work with industrial sensors, actuators, or fieldbus networks, you've almost certainly dealt with M12 connectors. The…
When someone first asks about a "C code M12 connector," it's easy to make a wrong choice and waste money or time on the wrong part.
A “C code M12 connector” is an M12-sized circular connector with a specific C keying pattern; to choose the correct one, confirm the coding, pin count, gender, interface layout, and cable assembly requirements.

When customers ask us about an M12 connector, we never start with price or samples. We confirm the coding, pin count, male/female direction, device interface, and how everything fits. This matters because two M12 connectors with the same pin count and size may still be completely incompatible with each other. If someone only asks for “M12, four pins,” that’s not enough. I have seen many projects delayed by parts that just won’t mate.
Many people think “C code” is a brand or model, but that’s not true; it’s the keying shape that prevents mis-mating.
A “C-coded” M12 connector means the key arrangement inside the shell is shaped like a letter C; this catches or blocks different mating patterns, making it fit only with a matching C-coded socket or plug.

I get this question often from buyers new to industrial connectors. The M12 connector family has many keying options, like A, B, C, D, X, S, T codes, each with a different notch or key pattern. The coding physically prevents wrong connections, much like how a specific house key only fits your door, not your neighbor’s. C-coded M12 connectors are often used for AC power in industrial automation1, and they are not interchangeable with, say, A-code (common for sensors) or D-code (common for Ethernet)2. Here’s a table that compares M12 coding types and their typical applications:
| M12 Coding | Key Shape | Pin Count | Typical Use | Interchangeable? |
|---|---|---|---|---|
| A-code | Linear | 3-12 | Sensors, actuators | No, unique key shape |
| [B-code | Offset | 5 | Fieldbus (Profibus)](https://en.wikipedia.org/wiki/IEC_metric_screw_sized_connectors)%%%FOOTNOTE_REF_3%%% | No, unique key shape |
| C-code | "C" notch | 3, 4 | AC power | No, unique key shape |
| D-code | "D" notch | 4 | Ethernet | No, unique key shape |
| [X-code | "X" strut | 8 | Gigabit Ethernet](https://en.wikipedia.org/wiki/IEC_metric_screw_sized_connectors)%%%FOOTNOTE_REF_4%%% | No, unique key shape |
If you get the coding wrong, you will not be able to connect to your device at all, no matter what the datasheet says.
More than half the time, customers think giving us just the pin count or IP67 is enough, but this leads to mismatched connectors.
Knowing only the pin number or how waterproof (IP rating) the part is will not guarantee compatibility; the coding, pin layout, interface gender, cable orientation, and locking style must match device requirements.

This is probably the mistake I see most often. I get requests for a “four-pin M12, IP67”, but there might be several versions—A-coded, B-coded, C-coded, right angle, straight, male, female. Even if the connector fits physically, the pinout may not match. “IP67” only confirms the connector’s ability to withstand water and dust, but nothing about how it connects. Whenever I get just a product photo, sample, or a vague drawing, I help customers by checking the key shape, metal latch positions, and counting pins. I then ask about mating style (male/female), mounting type (panel, cable, PCB), and orientation. It helps to send a picture of both the connector and the mating device. Here is a checklist I use every time:
It is critical to review every factor before confirming the part, otherwise you risk a lot of back-and-forth, delays, and sometimes expensive sample cycles.
A technically correct C-code M12 still might not work for your application if the voltage, current, cable size, or environment do not match.
You need to check the device's voltage, current, matching cable type, wire gauge, cable length, and working conditions along with the connector’s coding and pin pattern before you order.

It’s not just about the plastic or the metal shell. Specifications like voltage rating, current load, and even the thickness of the wires (wire gauge) must match your equipment needs7. For C-code M12 connectors, often used for AC power, they usually have higher voltage and current ratings, but you can’t assume this. The cable itself must have enough conductors (cores) and be thick enough for the load over the distance you need. I work with both machine builders and cabinet integrators who sometimes need custom cable lengths or halogen-free jackets8. I always ask up front about:
If your connector is correct but the cable assembly fails, you will have equipment downtime. Giving your supplier as much detail as possible reduces the risk of errors. Sending a diagram, photo, or sample helps identify exactly what you need.
Not every automation device uses C-code M12 connectors; always check against your project’s technical needs, device interface, standards, and future supply before choosing.
C-coded M12 connectors fit certain AC power and actuator interfaces but may not suit every new project; always check device side, application standards, supply chain, and project lifecycle for long-term fit.

I get requests from customers upgrading or replacing old lines who want to standardize connectors. C-code M12s are common in some European AC actuator systems9, but not in every PLC or sensor module. For a new project, confirm that your equipment side is actually designed for C-code, not A-code (much more common for sensors), or a more modern standard. Check the manufacturer’s datasheets or contact their support to confirm the interface. Availability also matters: if C-code is rare in your region or market, you may face project delays or supply risks if a model changes or goes obsolete. I always recommend:
Your supplier should help identify what you have from a sample, drawing, or photo, but you need to share all available technical details up front. This helps prevent wasted time or money later.
C-coded M12 connectors are just one piece of the puzzle—make sure you verify coding, device interface, electrical, and cable requirements before ordering to avoid wrong parts or costly delays.
"IEC metric screw sized connectors - Wikipedia", https://en.wikipedia.org/wiki/IEC_metric_screw_sized_connectors. IEC 61076-2-101 and related M12 connector standards define keying codes and their associated application domains; C-coding is associated with AC power interfaces in industrial environments, distinguishing it from A-code (sensors/actuators) and D-code (Ethernet) variants. Evidence role: definition; source type: institution. Supports: That C-coded M12 connectors are defined or commonly designated for AC power applications within industrial connector standards. Scope note: Specific edition and clause numbers should be verified against the current published standard, as application assignments may be updated in revisions. ↩
"IEC metric screw sized connectors - Wikipedia", https://en.wikipedia.org/wiki/IEC_metric_screw_sized_connectors. IEC 61076-2-101 defines M12 connector keying codes and their designated application areas; A-coding is specified for sensors and actuators while D-coding is designated for 100 Mbit/s Ethernet interfaces. Evidence role: definition; source type: institution. Supports: That A-coded M12 connectors are standardized for sensor and actuator use and D-coded for Ethernet applications. Scope note: Application designations reflect standardized intent but do not preclude proprietary or non-standard uses in specific equipment. ↩
"IEC metric screw sized connectors - Wikipedia", https://en.wikipedia.org/wiki/IEC_metric_screw_sized_connectors. IEC 61076-2-101 and the Profibus specification (IEC 61158/IEC 61784) designate the B-coded M12 connector with 5 contacts for Profibus fieldbus connections, with the offset keying preventing mis-mating with other M12 variants. Evidence role: definition; source type: institution. Supports: That B-coded 5-pin M12 connectors are designated for Profibus and fieldbus communication interfaces. Scope note: Some legacy Profibus installations may use alternative connector types; B-code M12 is the standardized but not universally adopted form. ↩
"IEC metric screw sized connectors - Wikipedia", https://en.wikipedia.org/wiki/IEC_metric_screw_sized_connectors. IEC 61076-2-109 specifies the X-coded M12 connector with 8 contacts, designed to support Gigabit Ethernet (1000BASE-T) in industrial environments, providing higher bandwidth than the 4-contact D-coded variant. Evidence role: definition; source type: institution. Supports: That X-coded 8-pin M12 connectors are standardized for Gigabit Ethernet applications. Scope note: Compatibility with specific Gigabit Ethernet implementations depends on additional cabling and equipment compliance beyond the connector standard alone. ↩
"IEC metric screw sized connectors - Wikipedia", https://en.wikipedia.org/wiki/IEC_metric_screw_sized_connectors. IEC 61076-2-101 specifies M12 connector variants by termination and mounting style, including cable-end (free) connectors, panel-mount (fixed) receptacles, and PCB-mount versions, each with defined mechanical interface dimensions. Evidence role: definition; source type: institution. Supports: That M12 connectors are standardized in panel, cable, and PCB mounting configurations. ↩
"IEC metric screw sized connectors - Wikipedia", https://en.wikipedia.org/wiki/IEC_metric_screw_sized_connectors. IEC 61076-2-101 and related parts of the IEC 61076 series define M12 connector coupling styles, including threaded (screw) locking as the primary type, with push-pull and snap variants addressed in supplementary specifications for applications requiring tool-free mating. Evidence role: definition; source type: institution. Supports: That M12 connectors are standardized with multiple coupling/locking mechanisms including threaded, bayonet, snap, and push-pull types. Scope note: Not all locking variants are covered under a single standard clause; push-pull M12 variants may be governed by manufacturer-specific or supplementary IEC specifications. ↩
"IEC 60309 - Wikipedia", https://en.wikipedia.org/wiki/IEC_60309. IEC 61076-2-101 specifies electrical characteristics including rated voltage and current for M12 connectors; IEC 60228 governs conductor cross-sections, and together these standards establish the basis for matching connector and cable electrical parameters to application requirements. Evidence role: expert_consensus; source type: institution. Supports: That connector voltage rating, current rating, and wire gauge must be matched to application requirements as defined by electrical safety standards. Scope note: Specific rated values vary by connector series and manufacturer; the standards define test and rating methods rather than prescribing universal values. ↩
"[PDF] USE OF LOW SMOKE AND HALOGEN FREE CABLES FOR ...", https://upcommons.upc.edu/bitstreams/097b72f0-7e8a-449c-b1a6-17841c50f393/download. IEC 60754-1/2 and EN 50267 specify test methods for halogen content and acid gas emission from cable materials; halogen-free jackets are required in applications where toxic gas emission during combustion poses a safety risk, and are increasingly mandated under RoHS and building/industrial fire safety regulations. Evidence role: mechanism; source type: institution. Supports: That halogen-free cable jacket materials are specified for industrial applications due to fire safety and environmental regulations. ↩
"IEC metric screw sized connectors - Wikipedia", https://en.wikipedia.org/wiki/IEC_metric_screw_sized_connectors. European industrial automation standards bodies, including those contributing to IEC 61076-2-101, have historically driven M12 connector coding conventions; C-coding for AC power reflects European actuator interface practices, though adoption varies by equipment manufacturer and sector. Evidence role: historical_context; source type: institution. Supports: That C-coded M12 connectors have particular prevalence in European industrial AC actuator applications. Scope note: No publicly available market share data directly quantifies regional adoption rates of specific M12 coding types; this claim reflects practitioner consensus rather than documented statistics. ↩
"[PDF] CISPR Guide 2024.pdf - IEC", https://assets.iec.ch/further_informations/1298/CISPR%20Guide%202024.pdf?0218T00. The EU EMC Directive (2014/30/EU) and Low Voltage Directive (2014/35/EU) impose EMC and safety requirements on electrical equipment including connectors placed on the European market; equivalent frameworks exist in other jurisdictions, such as FCC Part 15 in the United States and corresponding IEC/CISPR standards internationally. Evidence role: general_support; source type: government. Supports: That EMC and safety standards from national or international bodies apply to industrial connectors and must be verified for specific projects. Scope note: Applicability depends on the end product classification and market; connector components may be covered under the broader equipment certification rather than independently. ↩
NITAI manufactures terminal blocks, M8/M12 waterproof connectors and industrial distribution modules for global OEMs, distributors and automation customers.
Leave a Reply