Complete M12 connector pinout guide covering A-code, D-code, X-code, B-code and more. Learn 3-pin to 12-pin configurations, wiring, and how to choose the right M12 connector pinout for your application.
The M12 connector pinout defines the specific arrangement and function of each pin (contact) within an M12 circular connector. These rugged industrial connectors — standardized under IEC 61076-2-101 — use a 12mm threaded coupling interface and support pin configurations ranging from 3 to 12 contacts.
Each pin assignment maps a physical contact position to a wire function: power (positive/negative), ground, signal, data, or shield. The M12 connector pin configuration varies by coding type (A-code, D-code, B-code, X-code, T-code, K-code, etc.) and by pin count. Choosing the correct pin arrangement is essential for signal integrity, electrical safety, and system compatibility.
The key elements of any M12 connector pinout are:
Tip: Start your selection with our M12 Connector Selection Guide for a full overview of connector types and applications.
A wrong M12 connector pin configuration can cause serious problems:
Given that M12 connectors are used in automated production lines, the cost of a pinout mistake multiplies across every affected machine.
For detailed wiring instructions, see our M12 Connector Wiring Diagram article.
Before diving into specific pinouts, it helps to understand the numbering convention. All M12 connectors use a front-view perspective — looking at the male plug from the mating side:
This consistent numbering system means you can reliably identify each contact position across any M12 connector manufacturer, including KRONZ products.
A-code is the most widely used M12 connector coding type. It is designed for sensor and actuator connections in industrial automation. A-code connectors support 3, 4, 5, 8, and 12 pin configurations.
| Pin | Wire Color | Function |
|---|---|---|
| 1 | Brown (BN) | DC+ (Power +) |
| 2 | White (WH) | Signal / DC- |
| 3 | Blue (BU) | DC- (Power -) |
The 3-pin M12 connector pinout is the standard for two-wire DC sensors. Pin 1 carries power, pin 3 provides the ground return, and pin 2 doubles as the signal wire and DC- in a combined circuit. This is the simplest and most economical A-code configuration.
| Pin | Wire Color | Function |
|---|---|---|
| 1 | Brown (BN) | DC+ (Power +) |
| 2 | White (WH) | Signal (NO/NC) |
| 3 | Blue (BU) | DC- (Power -) |
| 4 | Black (BK) | Signal / auxiliary output |
The 4-pin A-code pin configuration separates the power and signal paths, making it ideal for three-wire sensors. Pin 4 often serves as a complementary output (NO+NC) or second signal channel.
| Pin | Wire Color | Function |
|---|---|---|
| 1 | Brown (BN) | DC+ (Power +) |
| 2 | White (WH) | Signal 1 |
| 3 | Blue (BU) | DC- (Power -) |
| 4 | Black (BK) | Signal 2 |
| 5 | Gray (GY) | Auxiliary / Earth ground |
The 5-pin A-code M12 connector pinout adds a dedicated auxiliary contact or earth ground. The reduced voltage rating (60V vs 250V) reflects the tighter pin spacing required for five contacts in the same 12mm housing.
| Pin | Wire Color | Function |
|---|---|---|
| 1 | White (WH) | Signal 1 |
| 2 | Brown (BN) | DC+ (Power +) |
| 3 | Green (GN) | Signal 2 |
| 4 | Yellow (YE) | Signal 3 |
| 5 | Gray (GY) | Signal 4 |
| 6 | Pink (PK) | Signal 5 |
| 7 | Blue (BU) | Signal 6 |
| 8 | Red (RD) | DC- (Power -) |
The 8-pin A-code M12 connector pin configuration supports six independent signal channels plus power and ground. This is the go-to choice for multi-function sensors and devices requiring simultaneous power, multiple discrete I/O, and analog signals.
The 12-pin A-code M12 connector pinout is the highest-density sensor connector in the A-code family. With 12 independent contacts, it can carry multiple analog signals, digital I/O, and power in a single connector — eliminating cable clutter in dense machine layouts.
Summary: A-code M12 connectors cover the full range from 3 to 12 pins. As pin count increases, current and voltage ratings decrease due to smaller contact size and tighter spacing. Always check the connector's datasheet for the exact M12 pin configuration of your model.
D-code connectors are built for industrial Ethernet networks, specifically PROFINET and EtherNet/IP.
| Pin | Function |
|---|---|
| 1 | TX+ (Transmit +) |
| 2 | RX+ (Receive +) |
| 3 | TX- (Transmit -) |
| 4 | RX- (Receive -) |
D-code uses the same 4-pin physical layout as A-code but with a different keying notch that prevents mismating. The M12 connector pinout for D-code follows the standard Ethernet MDI crossover pattern, making it directly compatible with PROFINET RJ45 ports using standard patch cables.
X-code connectors are the premium choice for gigabit and 10 Gigabit Ethernet in industrial environments. They are fully shielded and use 8 pins to support dual-pair transmission.
| Pin Pair | Function |
|---|---|
| 1+2 | TX1+ / TX1- |
| 3+6 | RX1+ / RX1- |
| 4+5 | TX2+ / TX2- |
| 7+8 | RX2+ / RX2- |
X-code is mechanically keyed to prevent accidental insertion into A-code or D-code ports. The M12 connector pin configuration for X-code supports simultaneous bidirectional full-duplex transmission at gigabit speeds, critical for bandwidth-intensive applications like machine vision.
B-code is designed for the Profibus-DP fieldbus protocol, commonly used in factory automation across Europe and Asia.
| Pin | Function |
|---|---|
| 1 | NC (Not Connected) |
| 2 | Green (Bus A / GN) |
| 3 | NC (Not Connected) |
| 4 | Red (Bus B / RD) |
| 5 | Shield / Earth Ground |
The B-code M12 connector pinout reserves two pins for the differential data bus (A and B) and uses the shield as pin 5. Pins 1 and 3 are left unconnected. The distinctive purple cable jacket follows Profibus color conventions.
Power-coded M12 connectors are designed for DC and AC power distribution in industrial equipment. They handle significantly higher currents than signal connectors.
| Pin | Wire Color | Function |
|---|---|---|
| 1 | Black (BK1) | DC+ |
| 2 | Black (BK2) | DC+ (parallel) |
| 3 | Black (BK3) | DC- |
| 4 | Yellow-Green (GN/YE) | Ground / Earth |
| Pin | Wire Color | Function |
|---|---|---|
| 1 | Black 1 (BK1) | L (Line) |
| 2 | Black 2 (BK2) | N (Neutral) |
| 3 | Black 3 (BK3) | L (Line, switched) |
| 4 | Yellow-Green (GN/YE) | PE (Protective Earth) |
| Pin | Wire Color | Function |
|---|---|---|
| 1 | Brown (BN) | L1 (Line 1) |
| 2 | White (WH) | L2 (Line 2) |
| 3 | Blue (BU) | N (Neutral) |
| 4 | Black (BK) | L3 (Line 3) |
| 5 | Yellow-Green (GN/YE) | PE (Protective Earth) |
| Pin | Wire Color | Function |
|---|---|---|
| 1 | Brown (BN) | DC+ |
| 2 | White (WH) | DC+ (sense/aux) |
| 3 | Blue (BU) | DC- |
| 4 | Black (BK) | DC- (return) |
| 5 | Gray (GY) | Signal / Shield |
Summary: Power-coded M12 connectors (T/S/K/L) share the same 12mm form factor but provide 12A at voltages up to 630VAC or 63VDC — ideal for replacing larger industrial power connectors in space-constrained applications.
| Coding | Pins | Application | Current | Voltage | Shielded |
|---|---|---|---|---|---|
| A-Code | 3 | Sensors / actuators | 4A | 250V | Optional |
| A-Code | 4 | Sensors / IO | 4A | 250V | Optional |
| A-Code | 5 | Dual-channel sensors | 4A | 60V | Optional |
| A-Code | 8 | Multi-signal | 2A | 30V | Optional |
| A-Code | 12 | High-density signals | 1.5A | 30V | Optional |
| D-Code | 4 | PROFINET / EtherNet/IP | 4A | 250V | Yes |
| X-Code | 8 | Gigabit / 10GB Ethernet | — | — | Yes |
| B-Code | 5 | Profibus-DP | 4A | 250V | Yes |
| T-Code | 4 | DC Power | 12A | 63VDC | Optional |
| S-Code | 4 | AC Power | 12A | 630VAC | Optional |
| K-Code | 5 | 3-Phase AC Power | 12A | 630VAC | Optional |
| L-Code | 5 | DC Power + Signal | 12A | 63VDC | Optional |
| Application | Recommended Coding |
|---|---|
| Simple sensor (on/off) | A-Code, 3-pin |
| Analog sensor (4-20mA) | A-Code, 4-pin |
| Dual-channel / safety sensor | A-Code, 5-pin |
| Multi-signal encoder | A-Code, 8-pin |
| High-density module | A-Code, 12-pin |
| PROFINET / EtherNet/IP | D-Code, 4-pin |
| Gigabit Ethernet | X-Code, 8-pin |
| Profibus-DP | B-Code, 5-pin |
| DC power distribution | T-Code or L-Code |
| AC / 3-phase power | S-Code or K-Code |
Need help deciding? Read our detailed guide on M12 A Code vs D Code vs X Code to understand the key differences.
Once you have selected a coding type, confirm:
| Product Type | Best For | Key Models (KRONZ) |
|---|---|---|
| Field-wirable | On-site installation, custom lengths | H1204F, H1204DFV-0 |
| Overmolded / molded | Pre-assembled, plug-and-play | M1204BF-2, M1205KF-2 |
| Flange mount | Panel-installed, PCB connection | F1204F, F1208M |
Mixing up polarity on 3-pin sensors — Connecting DC+ to pin 3 instead of pin 1 will damage the sensor immediately. Always verify the datasheet before wiring.
Using A-code for Ethernet — A-code and D-code look similar but have different internal pin assignments. A D-code connector in an A-code port will not transmit Ethernet signals correctly.
Ignoring voltage derating at higher pin counts — A 5-pin A-code connector is rated for only 60V, not 250V. Using it at full 250V creates a safety hazard.
Exceeding current per pin — An 8-pin A-code connector is rated for only 2A per pin. Connecting a motor drawing 4A will cause overheating and connector failure.
Confusing B-code and K-code — Both are 5-pin, but B-code is for Profibus data (4A/250V) while K-code is for 3-phase AC power (12A/630VAC). The physical keying differs — do not force a mismatched connection.
Skipping the shield connection on X-code — The shield on X-code connectors is critical for EMC performance. Leaving it unconnected defeats the purpose of the shielded design.
Warning: Always de-energize equipment before making or breaking M12 connections. Verify all pin assignments with a multimeter before applying power to a newly wired connector.
The M12 connector pinout system is a carefully designed standard that balances pin density, electrical performance, and mechanical keying across a wide range of industrial applications.
Three key takeaways:
Match the coding type to your protocol — A-code for sensors, D-code for PROFINET, X-code for gigabit Ethernet, and power codes (T/S/K/L) for DC and AC power distribution. The coding prevents costly mismating errors.
Understand the relationship between pin count and ratings — Higher pin counts enable more signals but reduce current and voltage capacity. Plan your power budget accordingly.
Always verify pin assignments before wiring — Even within the same coding type, application-specific variations exist. Consult the datasheet and our M12 Connector Wiring Diagram for every new installation.
KRONZ (KRONZ (Guangzhou) Electronics Co., Ltd.) offers a complete range of M12 connectors in all coding types and pin configurations, including field-wirable, overmolded, and flange-mount styles. Every connector meets IEC 61076-2-101 standards and carries IP67 protection for reliable performance in harsh industrial environments.
KRONZ provides professional M12 connector solutions tailored to your specific application requirements:
Contact KRONZ
If you still have questions about M12 connectors, please call 86-020-32981980 or contact us here. Discuss your M12 connector pin arrangement requirements with our engineering team.KRONZ offers a wide range of factory automation connections, including a comprehensive selection of UL-certified connections in our factory automation product catalog – there's something for everyone. If you don't find what you need, KRONZ also excels at custom cable orders, tailoring solutions to your unique application requirements!
For more information about M12 connections, please visit the KRONZ website:Click here to visit the KRONZ official website.
Complete M12 connector pinout guide covering A-code, D-code, X-code, B-code and more. Learn 3-pin to 12-pin configurations, wiring, and how to choose the right M12 connector pinout for your application.
The M12 connector pinout defines the specific arrangement and function of each pin (contact) within an M12 circular connector. These rugged industrial connectors — standardized under IEC 61076-2-101 — use a 12mm threaded coupling interface and support pin configurations ranging from 3 to 12 contacts.
Each pin assignment maps a physical contact position to a wire function: power (positive/negative), ground, signal, data, or shield. The M12 connector pin configuration varies by coding type (A-code, D-code, B-code, X-code, T-code, K-code, etc.) and by pin count. Choosing the correct pin arrangement is essential for signal integrity, electrical safety, and system compatibility.
The key elements of any M12 connector pinout are:
Tip: Start your selection with our M12 Connector Selection Guide for a full overview of connector types and applications.
A wrong M12 connector pin configuration can cause serious problems:
Given that M12 connectors are used in automated production lines, the cost of a pinout mistake multiplies across every affected machine.
For detailed wiring instructions, see our M12 Connector Wiring Diagram article.
Before diving into specific pinouts, it helps to understand the numbering convention. All M12 connectors use a front-view perspective — looking at the male plug from the mating side:
This consistent numbering system means you can reliably identify each contact position across any M12 connector manufacturer, including KRONZ products.
A-code is the most widely used M12 connector coding type. It is designed for sensor and actuator connections in industrial automation. A-code connectors support 3, 4, 5, 8, and 12 pin configurations.
| Pin | Wire Color | Function |
|---|---|---|
| 1 | Brown (BN) | DC+ (Power +) |
| 2 | White (WH) | Signal / DC- |
| 3 | Blue (BU) | DC- (Power -) |
The 3-pin M12 connector pinout is the standard for two-wire DC sensors. Pin 1 carries power, pin 3 provides the ground return, and pin 2 doubles as the signal wire and DC- in a combined circuit. This is the simplest and most economical A-code configuration.
| Pin | Wire Color | Function |
|---|---|---|
| 1 | Brown (BN) | DC+ (Power +) |
| 2 | White (WH) | Signal (NO/NC) |
| 3 | Blue (BU) | DC- (Power -) |
| 4 | Black (BK) | Signal / auxiliary output |
The 4-pin A-code pin configuration separates the power and signal paths, making it ideal for three-wire sensors. Pin 4 often serves as a complementary output (NO+NC) or second signal channel.
| Pin | Wire Color | Function |
|---|---|---|
| 1 | Brown (BN) | DC+ (Power +) |
| 2 | White (WH) | Signal 1 |
| 3 | Blue (BU) | DC- (Power -) |
| 4 | Black (BK) | Signal 2 |
| 5 | Gray (GY) | Auxiliary / Earth ground |
The 5-pin A-code M12 connector pinout adds a dedicated auxiliary contact or earth ground. The reduced voltage rating (60V vs 250V) reflects the tighter pin spacing required for five contacts in the same 12mm housing.
| Pin | Wire Color | Function |
|---|---|---|
| 1 | White (WH) | Signal 1 |
| 2 | Brown (BN) | DC+ (Power +) |
| 3 | Green (GN) | Signal 2 |
| 4 | Yellow (YE) | Signal 3 |
| 5 | Gray (GY) | Signal 4 |
| 6 | Pink (PK) | Signal 5 |
| 7 | Blue (BU) | Signal 6 |
| 8 | Red (RD) | DC- (Power -) |
The 8-pin A-code M12 connector pin configuration supports six independent signal channels plus power and ground. This is the go-to choice for multi-function sensors and devices requiring simultaneous power, multiple discrete I/O, and analog signals.
The 12-pin A-code M12 connector pinout is the highest-density sensor connector in the A-code family. With 12 independent contacts, it can carry multiple analog signals, digital I/O, and power in a single connector — eliminating cable clutter in dense machine layouts.
Summary: A-code M12 connectors cover the full range from 3 to 12 pins. As pin count increases, current and voltage ratings decrease due to smaller contact size and tighter spacing. Always check the connector's datasheet for the exact M12 pin configuration of your model.
D-code connectors are built for industrial Ethernet networks, specifically PROFINET and EtherNet/IP.
| Pin | Function |
|---|---|
| 1 | TX+ (Transmit +) |
| 2 | RX+ (Receive +) |
| 3 | TX- (Transmit -) |
| 4 | RX- (Receive -) |
D-code uses the same 4-pin physical layout as A-code but with a different keying notch that prevents mismating. The M12 connector pinout for D-code follows the standard Ethernet MDI crossover pattern, making it directly compatible with PROFINET RJ45 ports using standard patch cables.
X-code connectors are the premium choice for gigabit and 10 Gigabit Ethernet in industrial environments. They are fully shielded and use 8 pins to support dual-pair transmission.
| Pin Pair | Function |
|---|---|
| 1+2 | TX1+ / TX1- |
| 3+6 | RX1+ / RX1- |
| 4+5 | TX2+ / TX2- |
| 7+8 | RX2+ / RX2- |
X-code is mechanically keyed to prevent accidental insertion into A-code or D-code ports. The M12 connector pin configuration for X-code supports simultaneous bidirectional full-duplex transmission at gigabit speeds, critical for bandwidth-intensive applications like machine vision.
B-code is designed for the Profibus-DP fieldbus protocol, commonly used in factory automation across Europe and Asia.
| Pin | Function |
|---|---|
| 1 | NC (Not Connected) |
| 2 | Green (Bus A / GN) |
| 3 | NC (Not Connected) |
| 4 | Red (Bus B / RD) |
| 5 | Shield / Earth Ground |
The B-code M12 connector pinout reserves two pins for the differential data bus (A and B) and uses the shield as pin 5. Pins 1 and 3 are left unconnected. The distinctive purple cable jacket follows Profibus color conventions.
Power-coded M12 connectors are designed for DC and AC power distribution in industrial equipment. They handle significantly higher currents than signal connectors.
| Pin | Wire Color | Function |
|---|---|---|
| 1 | Black (BK1) | DC+ |
| 2 | Black (BK2) | DC+ (parallel) |
| 3 | Black (BK3) | DC- |
| 4 | Yellow-Green (GN/YE) | Ground / Earth |
| Pin | Wire Color | Function |
|---|---|---|
| 1 | Black 1 (BK1) | L (Line) |
| 2 | Black 2 (BK2) | N (Neutral) |
| 3 | Black 3 (BK3) | L (Line, switched) |
| 4 | Yellow-Green (GN/YE) | PE (Protective Earth) |
| Pin | Wire Color | Function |
|---|---|---|
| 1 | Brown (BN) | L1 (Line 1) |
| 2 | White (WH) | L2 (Line 2) |
| 3 | Blue (BU) | N (Neutral) |
| 4 | Black (BK) | L3 (Line 3) |
| 5 | Yellow-Green (GN/YE) | PE (Protective Earth) |
| Pin | Wire Color | Function |
|---|---|---|
| 1 | Brown (BN) | DC+ |
| 2 | White (WH) | DC+ (sense/aux) |
| 3 | Blue (BU) | DC- |
| 4 | Black (BK) | DC- (return) |
| 5 | Gray (GY) | Signal / Shield |
Summary: Power-coded M12 connectors (T/S/K/L) share the same 12mm form factor but provide 12A at voltages up to 630VAC or 63VDC — ideal for replacing larger industrial power connectors in space-constrained applications.
| Coding | Pins | Application | Current | Voltage | Shielded |
|---|---|---|---|---|---|
| A-Code | 3 | Sensors / actuators | 4A | 250V | Optional |
| A-Code | 4 | Sensors / IO | 4A | 250V | Optional |
| A-Code | 5 | Dual-channel sensors | 4A | 60V | Optional |
| A-Code | 8 | Multi-signal | 2A | 30V | Optional |
| A-Code | 12 | High-density signals | 1.5A | 30V | Optional |
| D-Code | 4 | PROFINET / EtherNet/IP | 4A | 250V | Yes |
| X-Code | 8 | Gigabit / 10GB Ethernet | — | — | Yes |
| B-Code | 5 | Profibus-DP | 4A | 250V | Yes |
| T-Code | 4 | DC Power | 12A | 63VDC | Optional |
| S-Code | 4 | AC Power | 12A | 630VAC | Optional |
| K-Code | 5 | 3-Phase AC Power | 12A | 630VAC | Optional |
| L-Code | 5 | DC Power + Signal | 12A | 63VDC | Optional |
| Application | Recommended Coding |
|---|---|
| Simple sensor (on/off) | A-Code, 3-pin |
| Analog sensor (4-20mA) | A-Code, 4-pin |
| Dual-channel / safety sensor | A-Code, 5-pin |
| Multi-signal encoder | A-Code, 8-pin |
| High-density module | A-Code, 12-pin |
| PROFINET / EtherNet/IP | D-Code, 4-pin |
| Gigabit Ethernet | X-Code, 8-pin |
| Profibus-DP | B-Code, 5-pin |
| DC power distribution | T-Code or L-Code |
| AC / 3-phase power | S-Code or K-Code |
Need help deciding? Read our detailed guide on M12 A Code vs D Code vs X Code to understand the key differences.
Once you have selected a coding type, confirm:
| Product Type | Best For | Key Models (KRONZ) |
|---|---|---|
| Field-wirable | On-site installation, custom lengths | H1204F, H1204DFV-0 |
| Overmolded / molded | Pre-assembled, plug-and-play | M1204BF-2, M1205KF-2 |
| Flange mount | Panel-installed, PCB connection | F1204F, F1208M |
Mixing up polarity on 3-pin sensors — Connecting DC+ to pin 3 instead of pin 1 will damage the sensor immediately. Always verify the datasheet before wiring.
Using A-code for Ethernet — A-code and D-code look similar but have different internal pin assignments. A D-code connector in an A-code port will not transmit Ethernet signals correctly.
Ignoring voltage derating at higher pin counts — A 5-pin A-code connector is rated for only 60V, not 250V. Using it at full 250V creates a safety hazard.
Exceeding current per pin — An 8-pin A-code connector is rated for only 2A per pin. Connecting a motor drawing 4A will cause overheating and connector failure.
Confusing B-code and K-code — Both are 5-pin, but B-code is for Profibus data (4A/250V) while K-code is for 3-phase AC power (12A/630VAC). The physical keying differs — do not force a mismatched connection.
Skipping the shield connection on X-code — The shield on X-code connectors is critical for EMC performance. Leaving it unconnected defeats the purpose of the shielded design.
Warning: Always de-energize equipment before making or breaking M12 connections. Verify all pin assignments with a multimeter before applying power to a newly wired connector.
The M12 connector pinout system is a carefully designed standard that balances pin density, electrical performance, and mechanical keying across a wide range of industrial applications.
Three key takeaways:
Match the coding type to your protocol — A-code for sensors, D-code for PROFINET, X-code for gigabit Ethernet, and power codes (T/S/K/L) for DC and AC power distribution. The coding prevents costly mismating errors.
Understand the relationship between pin count and ratings — Higher pin counts enable more signals but reduce current and voltage capacity. Plan your power budget accordingly.
Always verify pin assignments before wiring — Even within the same coding type, application-specific variations exist. Consult the datasheet and our M12 Connector Wiring Diagram for every new installation.
KRONZ (KRONZ (Guangzhou) Electronics Co., Ltd.) offers a complete range of M12 connectors in all coding types and pin configurations, including field-wirable, overmolded, and flange-mount styles. Every connector meets IEC 61076-2-101 standards and carries IP67 protection for reliable performance in harsh industrial environments.
KRONZ provides professional M12 connector solutions tailored to your specific application requirements:
Contact KRONZ
If you still have questions about M12 connectors, please call 86-020-32981980 or contact us here. Discuss your M12 connector pin arrangement requirements with our engineering team.KRONZ offers a wide range of factory automation connections, including a comprehensive selection of UL-certified connections in our factory automation product catalog – there's something for everyone. If you don't find what you need, KRONZ also excels at custom cable orders, tailoring solutions to your unique application requirements!
For more information about M12 connections, please visit the KRONZ website:Click here to visit the KRONZ official website.