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.