M12 Connector Guide: Coding, Pinouts, Ethernet, and Power

M12 is a mechanical interface family, not one universal pinout. Coding, contact count, gender, key orientation, wiring convention, and application standard must all agree. Use this guide to shortlist the correct interface, then confirm the exact drawing and pin assignment from the component manufacturer.
Quick Reference
| Code | Contacts | Data Rate | Typical Use |
|---|---|---|---|
| A-coded | 3, 4, 5, 8, 12 | Signal / low speed | Sensors, actuators, DC power |
| B-coded | 5 | Fieldbus | PROFIBUS, interbus |
| C-coded | 3, 4, 6 | AC power | Motors, AC power |
| D-coded | 4 | 100 Mb Ethernet | PROFINET, EtherNet/IP, EtherCAT |
| X-coded | 8 | 10 Gb Ethernet | High-speed industrial, GigE Vision |
| S-coded | 3, 4 | AC power (630V) | Motors, power |
| T-coded | 3, 4 | DC power (63V) | DC power distribution |
| K-coded | 4 | AC power (630V, 16A) | High-power motors |
1. The M12 Standard
M12 is the de facto standard for industrial sensor and actuator connections. The name refers to the 12mm threaded coupling diameter. M12 connectors are screw-locked, IP67-rated, and vibration-proof — exactly what factory automation demands.
Why M12 Dominates Factory Automation
| Feature | Benefit |
|---|---|
| Threaded coupling | Secure, vibration-proof (5g+ tested) |
| IP67 | Dust-tight, 1m immersion |
| Coding system | Prevents mismating signal types |
| Standardized | IEC 61076-2-101, global interoperability |
| Compact | 12mm — fits in dense panels |
| Field-wireable | Repair on site |
2. The Coding System (Why It Exists)
The M12 coding system prevents connecting a sensor cable (A-coded) to an Ethernet port (D-coded). Each code has a different key shape — physically impossible to mismate.
How to Identify
| Method | What You See |
|---|---|
| A-coded | Straight key slots, contacts at 0° offset |
| D-coded | Key slots offset 45° |
| X-coded | Two pairs of key slots (cross shape) |
| S/T-coded | Larger contacts (power), offset key |
3. Pinouts for Common M12 Codes
M12 A-coded (Sensor/Actuator, 4-pin)
| Pin | Sensor (NPN) | Sensor (PNP) |
|---|---|---|
| 1 | Brown (+24V) | Brown (+24V) |
| 2 | White (NC) | White (NC) |
| 3 | Blue (0V) | Blue (0V) |
| 4 | Black (Signal) | Black (Signal) |
M12 D-coded (Ethernet, 4-pin)
| Pin | Signal |
|---|---|
| 1 | TX+ (transmit+) |
| 2 | RX+ (receive+) |
| 3 | TX- (transmit-) |
| 4 | RX- (receive-) |
M12 X-coded (10GbE, 8-pin)
| Pin | Signal | Pin | Signal |
|---|---|---|---|
| 1 | DA+ | 5 | DC+ |
| 2 | DA- | 6 | DC- |
| 3 | DB+ | 7 | DD+ |
| 4 | DB- | 8 | DD- |
4. Straight vs Right-Angle (Angled)
| Type | Space Needed | Strain Relief | Best For |
|---|---|---|---|
| Straight (axial) | Cable exits along axis | Requires bend space | General, panel feed-through |
| Right-angle (90°) | Cable exits sideways | Better in tight enclosures | Motors, compact panels |
| 45° | Compromise | Moderate | Specialized |
5. Overmolded vs Field-Wireable
| Type | Assembly | Seal | Cost | Use |
|---|---|---|---|---|
| Overmolded (pre-terminated) | Factory, plug-and-play | Best (fully sealed) | Higher | Production, high-reliability |
| Field-wireable (screw/crimp) | On-site, tool needed | Good (O-rings) | Lower | Field repair, custom lengths |
6. M12 in Industrial Ethernet
M12 is replacing RJ45 in industrial networking:
| Factor | RJ45 | M12 D/X-coded |
|---|---|---|
| Vibration | ❌ Loose in vibration | ✅ Threaded lock |
| IP rating | IP20 typical | IP67 |
| Dust/moisture | Vulnerable | Sealed |
| Speed | Up to 10 GbE | X-coded: 10 GbE |
| Use | Office, data center | Factory floor, field |
For factory-floor Ethernet, M12 D-coded (100 Mb) and X-coded (10 Gb) are the standard.
Pin assignments can vary with application profiles and viewing direction. Verify the connector-face orientation and the manufacturer drawing before wiring.
7. Selection Checklist
Confirm coding, pin count, male/female side, shield continuity, cable category, conductor gauge, current derating, straight or angled exit, panel or cordset mounting, termination method, IP rating in the installed state, temperature range, and required approvals.
8. GSConn M12 Series
| Series | Code | Contacts | Data | IP | Features |
|---|---|---|---|---|---|
| M12-A-4 | A-coded | 4 | Signal/DC | IP67 | Sensor/actuator standard |
| M12-D-4 | D-coded | 4 | 100 Mb | IP67 | PROFINET, EtherNet/IP |
| M12-X-8 | X-coded | 8 | 10 Gb | IP67 | High-speed industrial |
| M12-T-4 | T-coded | 4 | DC power | IP67 | Power distribution |
| M12-FW | Field-wireable | varies | — | IP67 | On-site repair |
All GSConn M12 connectors are IEC 61076-2-101 compliant with gold-plated contacts and -40°C to +85°C rating.
GSConn M12 connectors cover A, B, C, D, X, S, T, and K codes in straight and right-angle versions, overmolded and field-wireable. IEC 61076-2-101 compliant, IP67 rated, and vibration-tested. Datasheets and 3D models available for all series.
Related reading:
– Circular Connector Selection Guide
– Vibration-Resistant Connector Guide
– Sealed vs Unsealed Connectors