0
0

M12 X-Code vs D-Code: What’s the Difference and Which Do You Need?

D-code — max speed
100Mb
4 pin — Cat5e
X-code — max speed
10Gb
8 pin — Cat6A
Both rated
IP67
Dust and water ingress protection

If you’re specifying industrial Ethernet connectivity for a machine, control panel, or automation system, the choice between M12 D-code and M12 X-code comes up on almost every project. The two connector types look similar — both are circular M12 connectors with a screw-lock thread — but they are mechanically incompatible by design, and they serve different purposes entirely.

This guide explains what each coding means, what the practical differences are, and how to determine which one your application actually requires.

What is an M12 connector and what does the coding mean?

M12 connectors are circular industrial connectors with a 12mm threaded locking mechanism. The thread provides a secure, vibration-resistant connection that a standard RJ45 push-in connector simply cannot match in demanding environments — on robot arms, machine tool controllers, outdoor enclosures, conveyor systems, or anywhere that sees vibration, shock, moisture, or chemical exposure.

The letter code — A, D, X and others — refers to the physical keying of the connector. Each coding has a different key position that physically prevents it from mating with a differently coded connector. This is not an arbitrary design choice. In an industrial environment where dozens of M12 connectors may be installed in close proximity, accidental mismating between a power connector and a data connector could damage equipment or cause network failures. The coding system prevents that entirely.

D-code and X-code are the two dominant codings for industrial Ethernet. They are the connectors you will encounter most frequently when specifying data connectivity for industrial automation, machine vision, robotics, and manufacturing infrastructure.

M12 D-code: 100Mb industrial Ethernet

The D-code connector is a 4-pin M12 connector designed for Fast Ethernet — 10/100 Mbps — and meets Cat5e performance standards. It has been the workhorse of industrial Ethernet connectivity for many years and remains the most widely deployed M12 Ethernet connector in existing industrial installations.

D-code is the standard connector for:

  • PROFINET networks operating at 100 Mbps
  • EtherCAT at 100 Mbps
  • EtherNet/IP at 100 Mbps
  • Modbus TCP and other fieldbus protocols running over standard Fast Ethernet
  • PLCs, I/O modules, sensors, actuators, and industrial switches in established automation networks

The 4-pin layout uses two twisted pairs — one for transmit, one for receive — which is all that Fast Ethernet requires. The connector is rated to IP67 when properly mated, providing protection against dust ingress and temporary water immersion to a depth of one metre.

D-code has been the standard for so long that the vast majority of industrial field devices — sensors, drives, cameras operating at 100Mb, junction boxes — ship with D-coded ports as standard. If the device you are connecting has a D-coded port, D-code is what you need. The code is not a choice — it is a requirement set by the equipment.

M12 X-code: 10Gb industrial Ethernet

The X-code connector is an 8-pin M12 connector defined by IEC 61076-2-109, designed to support Gigabit and 10 Gigabit Ethernet over Cat6A cabling. The X-shaped pin arrangement — which gives the connector its name — separates the four twisted pairs in a cross configuration that reduces crosstalk and maintains signal integrity at the higher frequencies required for 10Gb transmission.

X-code is the correct specification for:

  • Industrial Ethernet infrastructure requiring Gigabit or 10 Gigabit performance
  • Machine vision cameras using GigE Vision or 10GigE Vision protocols
  • High-speed robot controllers and motion control systems with high data throughput requirements
  • Edge computing and IIoT gateway connections where bandwidth is a priority
  • New industrial Ethernet installations being built for future performance headroom
  • PROFINET installations specified at Gigabit speeds

X-code cables are built around Cat6A — the same cable standard used for 10Gb office and data centre installations — with the addition of industrial-grade jacketing in PUR or PVC for resistance to oils, chemicals, UV, and mechanical stress. The connector itself is rated to IP67, with IP68 versions available for applications requiring submersion protection beyond the standard one-metre depth.

X-code is the newer of the two standards and is rapidly becoming the default specification for new industrial network infrastructure, particularly as machine vision systems, collaborative robots, and high-density sensor networks push bandwidth requirements beyond what 100Mb D-code can support.

D-code vs X-code: side-by-side

M12 D-code M12 X-code
Pin count 4 pin 8 pin
Max data rate 100 Mbps 10 Gbps
Cable standard Cat5e Cat6A
Twisted pairs used 2 pairs 4 pairs
IP rating IP67 when mated IP67 / IP68 when mated
Governing standard IEC 61076-2-101 IEC 61076-2-109
Can mate together? No — mechanically incompatible by design
Typical applications PLCs, sensors, 100Mb PROFINET Machine vision, 10Gb networks, high-speed automation

View our range of industrial M12 connectors and assemblies: M12 X-code connectors·M12 X-code assemblies·M12 D-code connectors·M12 D-code assemblies

How to determine which you need

In most cases, the equipment makes the decision for you. Check the Ethernet port specification on the device you are connecting — it will state either D-coded or X-coded. The connector on the cable must match the port on the device. If the device has a D-coded port, you need D-code cables and connectors. If it has an X-coded port, you need X-code. The physical keying means there is no ambiguity and no risk of using the wrong type accidentally.

Where the decision is less straightforward is in the infrastructure — the switches, panel mounts, and cable assemblies connecting devices together. Here, a few questions help narrow it down:

What speed does your network actually need? If the devices on the network operate at 100 Mbps — which covers the majority of existing PROFINET and EtherCAT deployments — D-code infrastructure is entirely appropriate and significantly more cost-effective than X-code. If any device requires Gigabit or 10 Gigabit connectivity, X-code is required at that link.

Are you building new infrastructure or extending existing? If extending an established 100Mb network, match the existing coding. If building from scratch and the budget allows, X-code is the future-proof choice — it supports 100Mb as well as Gigabit and 10Gb, so it will not need replacing as speeds increase.

What does the application demand? Machine vision cameras, particularly those using GigE Vision or 10GigE protocols, will specify X-coded connections. High-speed motion controllers, edge computing devices, and high-density data acquisition systems increasingly require Gigabit bandwidth. Standard sensor and actuator connections in established automation lines will typically be D-coded.

Field-wireable vs pre-assembled: a practical note

Both D-code and X-code connectors are available in two forms: field-wireable connectors that are terminated on site, and pre-assembled cable assemblies factory-terminated to a specified length.

Field-wireable connectors give flexibility on cable length and allow on-site repairs or modifications. They require careful termination — particularly X-code, where all four pairs must be correctly seated in the cross-pin arrangement — but are well suited to installations where exact cable runs are not known in advance, or where connector replacement in the field needs to be straightforward.

Pre-assembled cable assemblies are factory-terminated, tested, and ready to install. They eliminate termination errors entirely, which in high-speed X-code applications matters — a single mis-seated pair in a 10Gb link will degrade performance or cause the link to fail. For permanent infrastructure, machine tool connections, and any application where consistent performance is critical, pre-assembled assemblies are the lower-risk choice.

Frequently asked questions

Can I use an X-code connector on a D-coded device?

No. D-code and X-code connectors are mechanically keyed to prevent mismating. An X-code plug will not physically engage with a D-coded socket, and vice versa. This is a deliberate design feature of the M12 coding system — it prevents incorrect connections in environments where both connector types may be present on the same panel or machine.

Will an X-code cable work at 100 Mbps?

Yes, if the device port accepts X-code connections. X-coded infrastructure running Cat6A cable is fully capable of operating at 100 Mbps — it simply has significantly more headroom than is needed at that speed. Where all devices on a network are D-coded and operating at 100 Mbps, there is no technical benefit to specifying X-code infrastructure, and D-code remains the more cost-effective and practical choice.

What is the difference between IP67 and IP68?

Both ratings indicate full dust protection. IP67 covers temporary water immersion to one metre depth for up to 30 minutes. IP68 covers continuous immersion beyond one metre — the specific depth and duration are defined by the manufacturer. For most factory automation and machine tool applications, IP67 is sufficient. IP68 is specified for underwater applications, wash-down environments, or outdoor installations with prolonged exposure to standing water.

Do D-code and X-code connectors use the same cable?

No. D-code connectors use 4-core Cat5e cable with two twisted pairs. X-code connectors require 8-core Cat6A cable with four twisted pairs. The cables are not interchangeable — a D-code cable physically cannot be terminated into an X-code connector correctly, and attempting to do so would result in a non-functional or severely degraded link.

What other M12 coding types should I know about?

A-coded M12 connectors are the most common M12 type overall — typically 3, 4, or 5 pins — and are used for sensors, actuators, and general I/O in industrial automation. They are not used for Ethernet data connections. B-coded connectors are associated with legacy fieldbus protocols such as PROFIBUS. L, T, S, and K codings are used for power applications at higher currents and voltages. For industrial Ethernet data connectivity specifically, D-code and X-code are the two types you will encounter in the vast majority of applications.

Summary

D-code is the established standard for 100 Mbps industrial Ethernet — 4-pin, Cat5e, IP67, and appropriate for the majority of existing PROFINET, EtherCAT, and EtherNet/IP installations. X-code is the high-speed standard for Gigabit and 10 Gigabit industrial Ethernet — 8-pin, Cat6A, IP67/68, and the correct specification for machine vision, high-speed automation, and new infrastructure being built for long-term performance headroom.

In most cases the device determines which you need. Where the choice is yours — in infrastructure, switches, and panel mounts — the decision comes down to the bandwidth the network needs now and what it will need in the next five years.

If you need help specifying the right M12 connectors or assemblies for your installation, get in touch with the DTECH team — we supply M12 X-code and D-code connectors, assemblies, and panel mounts to installers and automation engineers across the UK, Europe, and the Middle East.

Share the Post:

Submit your Project For a Featured Case Study

Submit Your Project ->

Related Articles

01/01/2026

Solid vs Stranded Copper Data Cable: Which Do You Need?

Copper data cable comes in two fundamentally different conductor constructions: solid and stranded. The names describe exactly what they are — a solid core uses a single continuous copper wire...

01/12/2025

What is LSZH Cable and When Do You Need It?

LSZH stands for Low Smoke Zero Halogen. It describes a cable jacket compound that behaves fundamentally differently from standard PVC when it burns — producing significantly less smoke and releasing...

01/11/2025

Industrial RJ45 vs M12: Which Connector Is Right for Your Installation?

Industrial Ethernet connectivity comes down to one question before anything else: what environment is the connection actually living in? A standard RJ45 connector — the type on every office patch...

01/10/2025

M12 X-Code vs D-Code: What’s the Difference and Which Do You Need?

If you're specifying industrial Ethernet connectivity for a machine, control panel, or automation system, the choice between M12 D-code and M12 X-code comes up on almost every project. The two...