Skip to main content
RUGGED COMPUTING · TECHNICAL GUIDE

M12 Connectors Explained: Coding, Pinouts and Uses in Industrial Computers

M12 connectors carry power, sensor signals and Ethernet through a sealed, screw-locked circular connector built for vibration, water and dirt. Here is how M12 coding, pin counts and sizes work, and why rugged and waterproof computers use them.

TypeWhite paper
Published16 Sep 2022
AuthorAndrew WhitehouseCEO
Reading time32 min

An M12 connector is a circular industrial connector with a 12 mm metric screw-locking thread, written M12 × 1, that carries power, sensor signals and Ethernet through a sealed coupling rated IP67 or higher when mated. The IEC 61076-2 series of standards defines its shapes, codings and pin layouts, so plugs and sockets from different makers mate when their coding and pin count match.

Coding is what makes one connector serve so many jobs. Every M12 shares the same thread, and a key in the insert, with its own pin layout, decides what it carries: A-coded for sensors, signals and DC power, D-coded and X-coded for Ethernet, and L, T, S and K codings for power. A plug only mates with a socket of the same coding, which stops a sensor cable being screwed onto an Ethernet port. Our FAQ on M12 coding gives the short version.

This guide covers what M12 is and where it came from, a coding table with pins, uses, ratings and standards, D-coded and X-coded Ethernet including Power over Ethernet, pinouts and RJ45 mapping, sizes, how M12 compares with M8, RJ45 and 7/8 inch connectors, why rugged and waterproof computers use it, and how to specify it on an industrial computer.

Key points · 5 points

Key takeaways

01Coding decides the job
A-coded for sensors, signals and DC power; B for PROFIBUS; D and X for Ethernet; L, S, K and T for power.
02D or X for Ethernet
D-coded is 4-pin 10/100 Mbit/s; X-coded is 8-pin Gigabit and 10 Gigabit, and the two are not interchangeable.
03Sealed only when mated
An M12 socket is IP67 or better with a plug or a cap fitted; an open, unused socket is not.
04Built for vibration
The threaded coupling cannot shake loose like an RJ45 clip, which is why vehicles, trains and machines use it.
05Three standards cover most codings
IEC 61076-2-101 covers the signal and fieldbus codings, -109 covers X coding and -111 covers the power codings.
02Basics

What is an M12 connector?

An M12 connector is a round, threaded industrial connector named after its metric thread: 12 mm in diameter with a 1 mm pitch, written M12 × 1. It started out on sensors and actuators in factory automation and now carries industrial Ethernet, fieldbus and power as well. The IEC 61076-2 series of standards defines the shapes, codings and pin layouts, so connectors from different makers mate with each other when their coding and pin count match.

Each connection pairs a male plug, with pins, and a female socket, with contacts. Cables are usually fitted with plugs or sockets molded or field-wired on, while devices use panel-mount sockets. A knurled coupling nut screws the two halves together and compresses a seal, which is what makes M12 dependable where standard connectors work loose or let water in. Straight and right-angle versions suit tight installations, and shielded versions protect data against electrical noise.

M12 is one of a family of metric circular connectors; the difference between M8 and M12 is mainly size, pin count and power capacity.

What does M12 stand for?

The name is the thread size. In ISO metric notation, M12 means a 12 mm nominal diameter, and the × 1 that usually follows gives the 1 mm thread pitch. The smaller M8 connector follows the same pattern with an 8 mm thread.

03Coding

M12 coding at a glance

The table lists each coding with its usual pin counts, uses, typical ratings and the part of IEC 61076-2 that defines it. Ratings vary between makers, wire sizes and pin counts, so always check the datasheet of the connector and the device.

Coding Typical pins Used for Typical rating Standard
A 3, 4, 5, 8, 12 Sensors, actuators, DC power, serial, USB, digital I/O About 4 A on 3–5 pins, less on 8 and 12 pins IEC 61076-2-101
B 5 PROFIBUS fieldbus Signal level IEC 61076-2-101
C 3 to 6 AC sensors and AC power (older designs) Mains-voltage signal and low power IEC 61076-2-101
D 4 10/100 Mbit/s Ethernet, PROFINET, EtherNet/IP 100 Mbit/s on Category 5e cable IEC 61076-2-101
X 8 Gigabit and 10 Gigabit Ethernet, PoE 10 Gbit/s on Category 6A cable IEC 61076-2-109
L 5 Higher-current DC power, including PROFINET device power Up to 16 A at 63 V DC IEC 61076-2-111
T 4 DC power Up to 12 A at 63 V DC IEC 61076-2-111
S 3 + PE AC power Up to 630 V AC IEC 61076-2-111
K 4 + PE AC power, including three-phase Up to 630 V AC IEC 61076-2-111

The newer power codings carry supply currents that the signal codings cannot; the L-coded and other M12 power codings have their own FAQs. Hybrid Y-coded connectors, which combine Ethernet pairs and power contacts in one M12 insert, follow a further part of the series and are less common on computers.

Points · 9Coding

M12 coding explained

Every M12 connector shares the same thread, so coding adds a key and a pin layout for each use. A plug only mates with a socket of the same coding.

M12 A-coded connectors

The most common coding (more on A coding), used for sensors, actuators, DC power and general signals, with 3 to 12 pins. On industrial computers, A-coded connectors carry serial ports, USB, digital I/O and DC power input, each with its own pin count.

M12 B-coded connectors

Reserved for PROFIBUS fieldbus networks, usually with 5 pins (more on B coding). B coding keeps fieldbus cables separate from sensor and Ethernet cables on the same machine.

M12 C-coded connectors

Used for AC sensors and some AC power connections, with 3 to 6 pins. For higher AC power, the newer S and K power codings are replacing it.

M12 D-coded connectors

The original M12 Ethernet coding: 4 pins carrying 10/100 Mbit/s Ethernet, used for PROFINET and EtherNet/IP devices and for many rail and vehicle networks. See M12 D-coded connectors for the pinout.

M12 X-coded connectors

8 pins in four shielded pairs, carrying Gigabit and 10 Gigabit Ethernet. X coding is what most modern rugged computers use for their Gigabit ports, and it can carry Power over Ethernet with a suitable cable. See M12 X-coded connectors.

M12 L-coded connectors

A power coding for DC supplies up to 16 A at 63 V, used to feed PROFINET devices and field I/O modules in place of larger power connectors.

M12 T-coded connectors

A 4-contact power coding for DC supplies up to 12 A at 63 V, for devices that need more current than an A-coded connector carries.

M12 S-coded connectors

An AC power coding for supplies up to 630 V, with a protective earth contact, replacing C coding for AC power on newer equipment.

M12 K-coded connectors

An AC power coding with four contacts and earth for supplies up to 630 V, including three-phase supplies to motors and drives.

Coding

M12 standards: IEC 61076-2-101, -109 and -111

IEC 61076-2 is the part of the IEC 61076 connector series that covers circular connectors, and each M12 family has its own detail specification within it. Citing the part number on a specification is the clearest way to make sure a connector from one maker will mate with a cable from another.

Standard Covers Codings
IEC 61076-2-101 M12 connectors with screw locking for signals, sensors, fieldbus and 10/100 Ethernet A, B, C, D
IEC 61076-2-109 M12 connectors with screw locking for data rates up to 10 Gbit/s X
IEC 61076-2-111 M12 power connectors with screw locking L, T, S, K
IEC 60529 Degrees of protection provided by enclosures (IP codes) Sealing ratings such as IP67, all codings

IP ratings come from IEC 60529, not from the connector standards, and they apply to the mated pair or a capped socket. Our IP rating chart explains each level.

04Ethernet

M12 Ethernet connectors: D-coded vs X-coded

Industrial Ethernet is now the main job of M12 on computers. D-coded M12 carries 10/100 Mbit/s on two pairs and is common on PROFINET and EtherNet/IP devices, sensors and older rail networks. X-coded M12 carries all four pairs, in a shielded cross-shaped layout, for Gigabit and 10 Gigabit Ethernet.

Feature M12 D-coded M12 X-coded
Pins 4 8
Pairs 2 4, each in its own shielded quadrant
Ethernet speed 10/100 Mbit/s 10/100/1000 Mbit/s, 2.5 and 5 Gbit/s, 10 Gbit/s
Cable Category 5e Category 6A for 10 Gbit/s
Power over Ethernet Two-pair PoE and PoE+ on the data pairs Two-pair and four-pair PoE, including 802.3bt
Standard IEC 61076-2-101 IEC 61076-2-109
Typical devices PROFINET and EtherNet/IP field devices, older rail networks Rugged computers, cameras, M12 switches, rail and vehicle backbones

Most rugged and waterproof computers now ship with Gigabit, 2.5 Gigabit or 10 Gigabit ports on M12. To join an M12 device to a standard network, use a cable or adaptor of the same coding; the M12 to RJ45 FAQ shows how the pins map.

Industrial protocols follow the same split. PROFINET field devices running at 100 Mbit/s commonly use D-coded M12 and L-coded power, while Gigabit machine vision cameras, rail backbones and vehicle networks move to X-coded M12. Mixing the two on one cable route is common, with an M12 switch or a computer with both codings joining them, so list the coding of every device port before ordering cables.

Can M12 carry Ethernet and PoE?

Yes. X-coded ports carry PoE, PoE+ and four-pair PoE++ alongside Gigabit data, and D-coded ports carry two-pair PoE on their two data pairs. Many vehicle and rail computers use X-coded M12 ports to power cameras directly; the Vecow IVX-1000, for example, has eight X-coded 2.5GbE ports, four of them with 802.3at PoE+ at 25.5 W. The power levels, classes and budgets are the same as on RJ45, and our guide to industrial Power over Ethernet covers them.

Ethernet

M12 pin counts and pinouts

M12 connectors are specified by coding and pin count together: a 4-pin A-coded connector and a 4-pin D-coded connector will not mate. The most common layouts are:

4-pin A-coded. The standard sensor layout: pin 1 is the supply (brown), pin 3 is 0 V (blue), and pins 2 (white) and 4 (black) carry signals. The same connector is widely used for DC power input on computers.

5-pin and 8-pin A-coded. Extra pins for more signals, serial ports (RS-232 or RS-485) and USB, whose data pairs and power share one connector. On a 5-pin sensor cable, pin 5 is usually grey.

D-coded to RJ45

M12 D-coded pin Signal RJ45 pin (T568B)
1 Transmit + (TX+) 1
2 Receive + (RX+) 3
3 Transmit − (TX−) 2
4 Receive − (RX−) 6

X-coded to RJ45

M12 X-coded pin Pair RJ45 pin (T568B)
1 Pair A + 1
2 Pair A − 2
3 Pair B + 3
4 Pair B − 6
5 Pair D + 7
6 Pair D − 8
7 Pair C − 5
8 Pair C + 4

The X-coded mapping shown is the common one used for PROFINET and industrial Ethernet cable assemblies; check the cable maker’s drawing before wiring a field-attachable connector. Serial and USB pin assignments on M12 are not fully standardized between computer makers, so always check the device datasheet before wiring a cable.

Ethernet

M12 connector sizes and dimensions

All M12 connectors share the M12 × 1 thread. The coupling nut on the cable end is usually around 14 to 16 mm across, and straight connectors are typically 40 to 70 mm long including the cable strain relief, depending on the maker and whether the connector is molded or field-wireable. Right-angle versions trade length for height where space behind a panel is tight.

Panel-mount sockets on a computer are usually fitted front or rear through a round hole, with a PG9 or M16 mounting thread depending on the design, so check the cut-out on the datasheet when fitting M12 to your own enclosure. The smaller M8 connector uses an 8 mm thread and is used where space matters more than capacity.

Fitting and tightening M12 connectors

The seal only works when the coupling nut is fully tightened. Most makers specify a hand-tight fit or a small torque, often around 0.4–0.6 N·m, and some offer a torque tool; over-tightening can crack a plastic coupling or a molded insert. Route cables with a drip loop below the connector, support them with a strain relief or clamp near the panel, and keep a spare cap on a lanyard beside any port that is disconnected for maintenance. On vehicles, check couplings at the first service interval, as they can relax as seals bed in.

Ethernet

Male, female and adaptors

Always match coding and pin count as well as gender when choosing M12 cables and adaptors.

  1. 01

    M12 male connectors

    Plugs with exposed pins, usually on the cable end, that screw onto a female socket on the device.

  2. 02

    M12 female connectors

    Sockets with contacts, usually on the device or panel, that accept a male plug.

  3. 03

    M12 adaptors

    Gender changers, M12 to RJ45 adaptors and Y or T splitters for joining different cables and devices.

05Compared

M12 vs M8 vs RJ45 vs 7/8 inch connectors

M12 is not the only industrial connector. The table compares it with the three others an industrial computer buyer meets most often.

Feature M12 M8 RJ45 7/8 inch
Locking M12 × 1 screw thread M8 × 1 screw thread, or snap-in Plastic latch 7/8-16 UN screw thread
Sealing when mated IP67, some IP68 and IP69K IP67 IP20 as standard; sealed IP67 housings exist IP67
Vibration resistance High High Low; the latch can work loose High
Pins 3 to 12, by coding 3, 4, 6 or 8 8 2 to 6
Ethernet Up to 10 Gbit/s, X-coded Up to 100 Mbit/s, D-coded Up to 10 Gbit/s Not used for Ethernet
Power Up to 16 A with L coding A few amps PoE only Higher-current fieldbus power
Typical use Sensors, Ethernet and power on machines, vehicles and rail Small sensors where space is tight Cabinets, offices, commissioning Fieldbus power distribution

In practice, RJ45 stays inside clean cabinets and control rooms, M12 takes over wherever the cable is exposed to vibration, water or dirt, M8 covers small sensors, and 7/8 inch carries power along a fieldbus trunk.

Is M12 waterproof?

When mated or capped, yes: M12 connectors are typically rated IP67, and IP68 and IP69K versions are available for immersion and high-pressure washdown. An open socket is not sealed, so fit a protective cap to every unused M12 port on an IP-rated computer, or the enclosure loses its rating. Our FAQs on what IP67 means and IP69K vs IP67 explain the difference.

Computers

M12 computers, switches and cards from our range

These examples show how makers use the codings in practice. Facts come from each product’s own page.

Product Type M12 connectors Notes
Sintrones IBOX-600-M12X-ONX16 Jetson Orin NX rugged embedded PC 2.5GbE and GbE on X-coded; 9–60 V DC input on K-coded EN 50155, EN 45545-2 and E-Mark compliant
Vecow IVX-1000 Vehicle mounted computer Eight 2.5GbE on X-coded, four with PoE+; USB on A-coded 16–160 V DC input, designed for EN 50155
Forecr RAIBOX-ORNX-AB Jetson Orin NX EN 50155 computer Ethernet on X-coded; power, serial, CAN and DIO on A-coded IP67, designed to meet EN 50155 and EN 45545-2
Axiomtek tBOX520-ADL-MR Train computer 24–110 V DC on M12; LAN modules with A, X or D-coded M12 EN 50155 and EN 45545-2 certified
Antaira LMP-1802G-M12-10G-SFP-67-24 IP67 managed M12 switch 16 Gigabit PoE+ ports on X-coded; DC power on K-coded; console on A-coded EN 50121-3-2 and EN 50121-4 railway EMC
Antaira LNX-0800-M12-67 IP67 unmanaged M12 switch Eight 10/100 ports on D-coded; 12–48 V DC on A-coded EN 50121-3-2 and EN 50121-4 railway EMC
Axiomtek AX92325-4PoE PCIe PoE card Four Gigabit 802.3at PoE ports on X-coded Up to 30 W per port, 120 W in total

We configure, image and test every computer with its M12 ports, and specify the M12 cable assemblies, M12 to RJ45 patch leads and caps with the build, so the system arrives ready to connect. Antaira designs and builds its M12 switches, and we supply and specify them. For the network side, see our M12 Ethernet switches; for adding M12 camera ports to an existing computer, see Ethernet and PoE frame grabbers. On trains, M12 goes hand in hand with EN 50155, and railway projects can start from railway panel PCs as well as box computers. Our guide to types of rugged Ethernet switches covers M12 on the network side.

Specify · 6 checksM12

How to specify M12 on an industrial computer

Six decisions cover almost every M12 specification.

  1. 01

    List every connection

    Ethernet, serial, USB, digital I/O and power each need an M12 port of the right coding and pin count. Write the list before choosing a computer, so every port is on board rather than added through adaptors later.

  2. 02

    Match the network speed

    Choose X-coded ports for Gigabit and above, and D-coded only where the network runs at 100 Mbit/s.

  3. 03

    Plan PoE

    Check whether cameras or sensors will be powered over the same cable, and specify PoE and the total PoE budget on the M12 ports that need it.

  4. 04

    Plan the power

    Check the DC input range and the power connector on the datasheet, particularly on vehicles and trains, where supplies run from 9 V to 110 V and a sealed M12 power input keeps the whole system rated.

  5. 05

    Order the cables and caps

    Specify M12 cable assemblies of the right coding and length, M12 to RJ45 patch leads for commissioning, and caps for every spare port, at the same time as the computer.

  6. 06

    Check the approvals

    Match the IP rating, EN 50155 or EN 50121 rail approvals and temperature range to the installation, using each product’s datasheet.

07FAQs

M12 connectors: common questions

Quick answers

What is an M12 connector used for?

Sensors, Ethernet and power in harsh places. It connects sensors, actuators, fieldbus, Ethernet and power on machines, vehicles, trains and outdoor equipment where a sealed, vibration-proof connector is needed.

What is the difference between A-coded and D-coded M12?

The job and the key. A-coded carries sensors, signals and DC power with 3 to 12 pins; D-coded is a 4-pin connector for 10/100 Mbit/s Ethernet. They will not mate.

What does X-coded M12 mean?

The 8-pin Ethernet coding. X-coded M12 carries four shielded pairs for Gigabit and 10 Gigabit Ethernet, defined in IEC 61076-2-109.

Is M12 waterproof?

When mated or capped. M12 connectors are typically IP67 when a plug or cap is fitted; IP68 and IP69K versions exist. An open socket is not sealed.

What does the M12 stand for?

The thread size. M12 is a 12 mm metric thread, usually with a 1 mm pitch, written M12 × 1.

Can M12 carry Ethernet and PoE?

Yes. X-coded ports carry Gigabit data with two-pair or four-pair PoE, and D-coded ports carry two-pair PoE at 10/100 Mbit/s.

What is the difference between M8 and M12 connectors?

Size, pins and power. M8 has an 8 mm thread and fewer pins for small sensors; M12 is larger and carries more pins, higher current and faster Ethernet.

How many pins does an M12 connector have?

3 to 12, depending on coding. A-coded comes in 3, 4, 5, 8 and 12 pins, D-coded has 4, X-coded has 8 and the power codings have 4 or 5 including earth.

FAQs

M12 connector FAQs

  1. What Is M12 Coding?

    M12 coding is the key and pin layout inside an M12 connector that stops incompatible plugs and sockets being mated. Each coding has a job: A for sensors and DC power, B for PROFIBUS, D and X for Ethernet, and L, T, S and K for power. A plug only fits a socket with the same coding.

  2. What Is an M12 A-Coded Connector?

    An M12 A-coded connector is the most common M12 coding, used for sensors, actuators, low-voltage DC power and general signals. It has a single key and comes with 3, 4, 5, 8 or 12 pins, defined in IEC 61076-2-101. On industrial computers, A-coded connectors carry DC power input, serial ports, USB and digital I/O.

  3. What Is an M12 D-Coded Connector?

    An M12 D-coded connector is the 4-pin M12 coding for 10/100 Mbps Ethernet. It is used for PROFINET, EtherNet/IP, EtherCAT and many rail and vehicle networks. Pins 1 and 3 carry the transmit pair and pins 2 and 4 the receive pair. It is defined in IEC 61076-2-101.

  4. What Is an M12 X-Coded Connector?

    An M12 X-coded connector is the 8-pin M12 coding for Gigabit and 10 Gigabit Ethernet. Its four twisted pairs are separated by a cross-shaped shield that controls crosstalk at high speed, and it can carry Power over Ethernet with a suitable cable. It is defined in IEC 61076-2-109.

  5. How Do You Connect M12 to RJ45?

    An M12 Ethernet port connects to an RJ45 network with an M12 to RJ45 cable or adaptor that matches the port’s coding. A 4-pin D-coded M12 carries 10/100 Mbps Ethernet on RJ45 pins 1, 2, 3 and 6; an 8-pin X-coded M12 carries Gigabit and faster Ethernet on all eight RJ45 pins.

  6. What Is the Difference Between M8 and M12 Connectors?

    M8 and M12 are circular industrial connectors named after their thread: 8 mm and 12 mm. M8 is smaller, with 3 to 8 pins, and suits compact sensors and low-power signals. M12 is larger, with up to 12 pins and more codings, and carries higher power and Ethernet up to 10 Gbit/s, which is why industrial computers use it.

  7. What Is an M12 B-Coded Connector?

    An M12 B-coded connector is the M12 coding reserved for PROFIBUS fieldbus networks. It usually has 5 pins and a key on the opposite side to A coding, so a fieldbus cable cannot be connected to a sensor or power port by mistake. It is defined in IEC 61076-2-101.

  8. What Is an M12 L-Coded Connector?

    An M12 L-coded connector is an M12 power coding for DC supplies, rated up to 16 A at 63 V and defined in IEC 61076-2-111. It is used mainly to distribute 24 V power to PROFINET devices and field I/O, replacing larger 7/8 inch power connectors, and has 4 or 5 contacts.

  9. Which M12 Codings Are Used for Power?

    M12 power connectors use dedicated codings. L and T coding carry DC power, up to 16 A and 12 A at 63 V; S and K coding carry AC power up to 630 V. The older C coding was used for AC sensors and power. Low-current DC supplies, such as many computers’ power inputs, often use A coding.

// NEXT STEP

Specifying a computer with M12 connectors?

Tell us which devices the computer connects to, the environment it runs in and how it is powered. We will recommend a computer with the right M12 ports and coding, then configure, image and test it with its cables specified, ready to install.

Phone · USA +1 407 214 9446