M12 connectors are the workhorse circular connector of industrial automation — a 12 mm threaded interface that carries sensor signals, fieldbus and industrial Ethernet, and power in environments where vibration, dust, and washdown would defeat an ordinary connector. This guide covers what defines an M12, how the coding system works, the pinouts for each common code, dimensions, IP ratings, and the IEC standards that govern them — so you can specify the right part with confidence.
What is an M12 connector?
An M12 connector is a circular connector named for its M12 × 1 metric thread (12 mm outer diameter, 1 mm pitch). The threaded coupling nut locks the mated pair together and holds the connection secure under shock and vibration. In industry nomenclature it is the “Micro” size — larger than the M8 “Pico” and smaller than the 7/8″ “Mini.” A typical M12 pairs a male plug (pins) with a female receptacle (sockets), and handles signal, data, and power depending on its coding and pin count.
In plain terms
M12 connectors come in different “codings” (A, B, D, X and more), which is really just keying that stops the wrong cable going into the wrong port. Rule of thumb: A-coded for sensors and DC power, B-coded for fieldbus, D-coded for 100 Mbit Ethernet, and X-coded for Gigabit Ethernet. Match the coding on both the cable and the device and it physically cannot mate wrong.
M12 coding types
“Coding” refers to the keyway pattern molded into the connector. Each code physically prevents mismating with an incompatible one, and each is associated with a typical application and pin count:
| Code | Primary use | Typical pins | Notes |
|---|---|---|---|
| A | Sensors, actuators, DC signal/power | 3, 4, 5, 8, 12 | Most common code |
| B | PROFIBUS / INTERBUS fieldbus | 5 (also 2, 4) | — |
| C | AC sensors / actuators | 3–6 | Double keyway; older, less common |
| D | Industrial Ethernet (PROFINET, EtherCAT) | 4 only | 100 Mbit/s, two pairs |
| X | High-speed Ethernet | 8 only | Up to 10 Gbit/s (Cat6A), four pairs |
| S / K | AC power | multiple + PE | S ≤ 12 A, K ≤ 16 A (≤ 630 V) |
| T / L | DC power | 4 + PE | T ≤ 12 A, L ≤ 16 A (≤ 63 V) |
M12 pinouts by coding
Always confirm against the specific part’s datasheet, but these are the standardized assignments engineers reach for most.
A-coded, 4-pin (sensor)
| Pin | Wire | Function |
|---|---|---|
| 1 | Brown | L+ (+V, e.g. +24 VDC) |
| 2 | White | Signal / I/O |
| 3 | Blue | L− (0 V) |
| 4 | Black | Signal / output |
A-coded, 5-pin (sensor, IO-Link, dual-output)
The 5-pin A-code is the workhorse for sensors with two outputs, analog devices, and IO-Link masters. Pins 1 and 3 carry power; the remaining pins carry signal.
| Pin | Wire | Function |
|---|---|---|
| 1 | Brown (BN) | L+ — positive supply, e.g. +24 VDC |
| 2 | White (WH) | Signal / output 2 (or analog output) |
| 3 | Blue (BU) | L− — negative supply / 0 V return |
| 4 | Black (BK) | Signal / output 1 (IO-Link C/Q on IO-Link devices) |
| 5 | Grey (GY) | Functional earth or an additional signal — varies by device |
D-coded, 4-pin (PROFINET / Ethernet, 100 Mbit/s)
Two pairs: (1,3) transmit, (2,4) receive.
| Pin | Function |
|---|---|
| 1 | TX+ |
| 2 | RX+ |
| 3 | TX− |
| 4 | RX− |
X-coded, 8-pin (10 Gbit/s)
Four shielded differential pairs.
| Pins | Pair |
|---|---|
| 1–2 | Data pair A (+/−) |
| 3–4 | Data pair B (+/−) |
| 5–6 | Data pair D (+/−) |
| 7–8 | Data pair C (+/−) |
Need the assembly rather than the theory? See Circuit Assembly’s custom M12 cable assemblies and cordsets — A-, B-, D- and X-coded, overmolded or field-wireable, built to your print.
M12 wire colors and polarity
On a standard A-coded DC sensor cordset, brown is positive and blue is negative. Brown carries L+ (typically +24 VDC) on pin 1, and blue carries L− (0 V return) on pin 3. Black and white are signal or output conductors, and grey — when a fifth conductor is present — is usually functional earth or a second signal.
These colors follow the sensor and actuator convention in IEC/EN 60947-5-2, which is why the same brown/blue power pair repeats across nearly every A-coded sensor cable regardless of manufacturer. Data codings (D and X) do not use this scheme — their conductors are twisted pairs identified by Ethernet pair colors instead.
| Wire color | Abbrev. | Typical function |
|---|---|---|
| Brown | BN | L+ / positive supply |
| Blue | BU | L− / negative supply, 0 V |
| Black | BK | Output or signal (primary) |
| White | WH | Output or signal (secondary) |
| Grey | GY | Functional earth or additional signal |
Polarity and pin function are set by the device, not the cable — always confirm against the sensor or actuator datasheet before wiring, especially on analog and IO-Link devices where pin 2 and pin 5 assignments differ.
Pin count, gender, and mounting
- Pin count — 2 to 17, matched to the signal and power lines required.
- Gender — male (plug, pins) or female (receptacle, sockets).
- Mounting — cable mount, panel/bulkhead mount (installs through a 12 mm threaded bushing), and PCB mount.
- Termination — factory crimp or overmolded, or field-wireable screw and IDC (insulation-displacement) terminals.
Dimensions and thread
All M12 codes share the same M12 × 1 threaded coupling (12 mm nominal diameter, 1 mm pitch) — only the keyway differs between codes, which is what enforces correct mating. The coupling nut is hand-tightened; torque the coupling to the value on the connector manufacturer’s datasheet. Mating depth, hex size, and cable OD vary by series, so dimension them from the specific datasheet.
IP ratings
When mated and properly tightened, the M12 form factor is sealed to IP67 — protection against dust and temporary immersion. Higher ratings such as IP68 and IP69K (extended immersion and high-pressure, high-temperature washdown) are offered on some series. Ratings apply only to a correctly mated and tightened pair; an unmated connector is not sealed. Circuit Assembly builds M12 cordsets to IP67.
Governing standards
- IEC 61076-2-101 — A-, B-, C-, and D-coded M12 connectors
- IEC 61076-2-109 — X-coded M12 (10 Gbit/s data)
- IEC 61076-2-111 — S-, T-, K-, and L-coded M12 power connectors
How to select an M12 connector
- Coding — driven by your protocol or power type (D or X for Ethernet, A for sensors, S/K for AC power, T/L for DC power).
- Pin count — enough for your signal and power lines, no more.
- Gender and orientation — plug vs. receptacle; straight vs. right-angle.
- Mounting and termination — cable vs. panel/bulkhead; factory-terminated vs. field-wireable.
- IP rating — match the washdown/immersion exposure.
- Cable — conductor gauge, shielding (essential for X/D data), jacket material, and length.
Custom M12 cable assemblies, built to your spec
Circuit Assembly manufactures custom M12 cable assemblies and cordsets — M12-to-M12, M12-to-flying-lead, and M12-to-RJ45 — in any coding, overmolded or field-wireable, built to your drawings and specifications. With an AS9100D-certified quality management system and assemblies built to IPC/WHMA-A-620 workmanship standards, we supply M12 interconnects for industrial automation, robotics, and factory-network applications.
Request a quote for M12 assemblies built to your spec.
Quality certifications & compliance
Circuit Assembly is certified to ISO 9001:2015 and AS9100D, and registered with the U.S. Department of State for ITAR compliance, so aerospace and defense work is built to the right quality system and managed under U.S. export-control law.

ISO 9001:2015 & AS9100D
Certified Quality Management System (QMS) for aerospace and defense.

DDTC Registered (ITAR) for Aerospace & Defense
ITAR-compliant program for export-controlled defense work.
M12 connector FAQ
What do the M12 coding letters (A, B, C, D, X) mean?
Coding is the keyway pattern molded into the connector that matches it to its application and physically prevents mismating: A for sensors and DC signal/power, B for PROFIBUS fieldbus, C for AC sensors, D for 100 Mbit/s industrial Ethernet, and X for Ethernet up to 10 Gbit/s. S, K, T and L codes are reserved for AC and DC power.
What is the difference between a D-coded and X-coded M12?
D-coded is 4-pin and carries Fast Ethernet at 100 Mbit/s over two pairs. X-coded is 8-pin and carries up to 10 Gbit/s over four shielded pairs. They are not intermateable, so the coding must match the device port.
What is the M12 pinout for a 4-pin A-coded sensor?
Pin 1 is brown (L+, typically +24 VDC), pin 2 is white (signal or output 2), pin 3 is blue (L−, 0 V), and pin 4 is black (signal or output 1). Always confirm against the device datasheet.
What is the M12 pinout for a 5-pin A-coded connector?
Pin 1 brown (L+), pin 2 white (signal or analog output), pin 3 blue (L−, 0 V), pin 4 black (signal or IO-Link C/Q), and pin 5 grey (functional earth or an additional signal, depending on the device).
Which M12 wire is positive and which is negative?
On a standard A-coded DC sensor cordset, brown is positive (L+, typically +24 VDC) and blue is negative (L−, the 0 V return). Black and white are signal conductors. This color convention follows IEC/EN 60947-5-2.
What M12 wire colors are standard?
Brown (BN) is L+, blue (BU) is L−, black (BK) is the primary output or signal, white (WH) is the secondary output or signal, and grey (GY) is functional earth or an additional signal. Data codings such as D and X use Ethernet pair colors instead.
What thread does an M12 connector use?
All M12 codings share an M12 × 1 threaded coupling — 12 mm nominal diameter with 1 mm pitch. Only the keyway differs between codes, which is what enforces correct mating. The coupling nut is hand-tightened to the torque given on the connector datasheet.
How many pins can an M12 connector have?
A-coded M12 connectors are available in 3, 4, 5, 8 and 12 positions. D-coded is 4-pin only and X-coded is 8-pin only. Power codings use 4 contacts plus PE.
What IP rating do M12 connectors have?
The M12 form factor is rated to IP67 when mated and properly tightened, and some series are offered to higher ratings. The rating only applies to a correctly tightened, fully mated pair — unmated ports need a protective cap. Circuit Assembly builds M12 cordsets to IP67.
Can Circuit Assembly build custom M12 cable assemblies?
Yes. Circuit Assembly manufactures M12-to-M12, M12-to-flying-lead, and M12-to-RJ45 cordsets in any coding, overmolded or field-wireable, built to your drawing and specification under an AS9100D and ISO 9001:2015 quality management system.
