Everything About M12 Connector Coding , Coding Chart , Pinout , Color Code , Wiring Diagram
Date : 11-04-2023
M12 connector is the most widely used waterproof circular connector in automation field and other applications, for some newcomers or those who want to know more about this connector, It looks very difficult to understand these words M12 connector pinout , M12 connector color code , M12 coding , coding chart , M12 wiring diagram , but these words are very important to understand the M12 connector and its installation and application.
This article will introduce the M12 connector and the important special features mentioned above. First, let’s understand what is the M12 connector.

1. Definition Of M12 Connector
M12 connector is circular connector with 12mm locking thread diamter which was designed to be waterproof in order to protect the electrical contacts from moisture, dust, and other environmental contaminants. The connector’s waterproofing is achieved through the use of specialized materials, coatings, and sealing techniques.
The housing of M12 connectors is typically made from a durable and corrosion-resistant material, such as stainless steel , Zinc alloy or plastic, which can withstand exposure to harsh environmental conditions. The connector pins are also designed to be highly resistant to corrosion, which helps to ensure that the electrical connections remain reliable over time.
In addition, M12 connectors are often rated for a high level of ingress protection, such as IP67 or higher, which means that they are completely sealed against the entry of dust and can withstand immersion in water for a specified period of time. To achieve this level of protection, the connectors are often equipped with rubber or silicone seals that are compressed between the mating surfaces of the connector when it is locked into place. This helps to create a tight seal that prevents water and other contaminants from entering the connector and damaging the electrical contacts.
M12 connector are available for 2-pin , 3-pin , 4-pin , 5-pin , 6-pin , 8-pin , 12-pin and 17-pin , and have various coding types.
2. What Is M12 Coding And M12 Coding Chart
M12 connectors are available in various coding types to prevent mismating of connectors with different functions or to allow different applications to use the same connector style without interference. The shape of the insulator , pin position , even pin contact diamter vary by codings . The M12 coding chart shows the coding types of M12 connectors , as following , A stands for A code , B stands for B code , others are the same :

The most common M12 coding types( the word coded means coding ) are as following :
M12 A-code : available for 2 , 3 , 4 , 5 , 6 , 8 , 12 , 17 pin , are mainly used for sensor , actuator , small power and data transmission
M12 B-code : 5 pin , could be used for fieldbus such as Profibus and Interbus.
M12 C-code : 3 , 4 , 5 ,6 pin , can be used for sensor and AC power supplier.
M12 D-code : 4 pin , widely used for 100M data transmission , such as industrial ethernet , machine vision.
M12 X-code : 8 pin , widely used for 10G bps data transmission , such as industrial ethernet , machine vision.
M12 Y-code : 6 , 8 pin , hybrid connector , include power and data connection in one connector , suitable for compact applications。
M12 S-code : 2 pin , 2+PE , 3+PE , rated voltage 630V, current 12A, designed for AC power connection such as motors, frequency-convertors, motor operated switches.
M12 T-code : 2 pin , 2+PE , 3+PE , rated voltage 60V, current 12A, designed for DC power connection , such as fieldbus power supplier , DC motors.
M12 K-code : 2 pin , 2+PE , 3+PE , 4+PE , rated voltage 800V, current 16A, up to 10KW, can be used for high power AC power supplier.
M12 L-code : 2 pin , 2+PE , 3 pin , 3+PE , 4 pin , 4+PE , rated voltage 63V, 16A, DC power connector such as PROFINET power supplier.
M12 M-code : 2 pin , 2+PE , 3+PE , 4+PE , 5+PE , rated voltage 630V, 8A, designed for three phase power connection.
Note : “PE” often refers to “Protective Earth,” which is a safety ground connection used to protect users and equipment from electric shock in the event of a fault. The PE connection is typically connected to a ground pin on a power plug or connector. So, technically speaking, a ground pin can be considered a PE connection, but it’s important to note that not all ground connections are necessarily PE connections.
How can we know the arrangement of pins and their functions ? The M12 connector pinout will make you clear about it.
3. What Is M12 Connector Pinout
Pinout tells the pin arrangement of M12 connectors, such as which pin is pin 1 , which is pin 2 and their postion, different coding types of M12 connectors have different pinouts and configurations , even same pin and coding type , the male and female M12 pinout are different. Before connecting any devices to an M12 connector, it’s important to confirm the pinout and ensure that the connector is compatible with the devices you are connecting.
On the front of the connector interface, some connector manufacturers mark the pin number, but for M12 cable, if we don’t know the M12 color code, we don’t know which wire corresponds to the pin number, so we can’t install it correctly。
4. What Is M12 Color Code
M12 color code have same meaning as M12 wiring diagram , it shows the color of the wires that connected to the pins, so the engineers will know which wire is connected to pin 1 , which wire is connected to pin 2 and so on.
Then the following content is about the pinout and color code for different coding M12 connectors.
5. M12 A Code Connector Pinout And Color Code
A coded M12 connector have 2 , 3 , 4 , 5 , 6 , 8 , 12 , 17 pin for option, the pinout and color code wiring diagram is as following :
Male Female A-Coded M12 2 Pin Connector Pinout

A-Coded M12 2 Pin Connector Color Code

A Coded M12 3 Pin Connector Male Female Pinout

M12 A Coded 3 Pin Connector Color Code

Male Female A-Coded M12 4 Pin Connector Pinout

M12 A Coded 4 Pin Connector Color Code

Male Female A-Coded M12 5 Pin Connector Pinout

M12 5 Pin Connector Color Code

M12 A-coded 6 Pin Connector Pinout

M12 6 Pin Connector Color Code

M12 A-coded 8 Pin Connector Pinout
8 pin A coded connector could connect RJ45 used for ethernet cable.

M12 8 Pin Connector Color Code

M12 A-coded 12 Pin Connector Pinout

M12 12 Pin Connector Color Code

M12 17 Pin Connector Pinout

M12 17 Pin Connector Color Code

6. 5-Pin M12 B-coded Connector Pinout

B-Coded M12 5 Pin Connector Color Code

7. M12 C Coded Connector Pinout
C coded M12 connector have 3 pin , 4 pin , 5 pin and 6 pin .

8. 4 Pin M12 D Coded Connector Pinout

4 Pin M12 D-Coded Connector Color Code

9. 8 Pin M12 X-Coded Connector Pinout

8 Pin M12 X Coding Connector Color Code And Wiring Diagram

10. 8 Pin M12 Y-Coded Connector Pinout

8 Pin M12 Y Coding Color Code And Wiring Diagram

11. 2-Pin 2+PE 3+PE M12 S-Coded Connector Pinout

M12 S Coding Connector Color Code Wiring Diagram

12. 2-Pin 2+PE 3+PE M12 T Coded Connector Pinout

M12 T Coding Connector Color Code Wiring Diagram

13. 2-Pin 2+PE 3+PE 4+PE M12 K Coded Connector Pinout

M12 K-Coded Connector Color Code Wiring Diagram

14. 3-Pin 3+PE 4+PE M12 L-Coded Connector Pinout

M12 L-Coded Connector Color Code Wiring Diagram

15. 2-Pin 3+PE 4+PE 5+PE M12 M-Coded Connector Pinout

M12 M-Coding Connector Color Code Wiring Diagram

16. Ethernet D Coded M12 4 Pin To RJ45 Pinout

EtherNET-IP 4 Pin M12 D Coded To RJ45 Pinout

17. Industry Ethernet 8 Pin M12 A Coded To RJ45 Pinout


18. Ethernet CAT6A 8 Pin M12 X Coded To RJ45 Pinout

19. DB9 To A Coded Connector 5 Pin M12 Profibus Pinout Wiring Diagram

20. CANopen M12 Pinout

21. DeviceNet M12 Pinout

22. IO-Link M12 Pinout

23. M12 Power Connector Pinout

24. M12 Sensor Cable Connector Pinout

If you have any other questions for the M12 connector pinout , color code , coding type , welcome to contact us.
Leave a Reply