M8 Connector Guide: Coding, Pin Counts and When to Use M8

Short answer M8 connectors are the small brother of M12: an 8 mm threaded coupling for sensors and actuators where space is tight. Most M8 parts are A-coded with 3 or 4 pins. Match the coding first, then the pin count, then male or female, and remember that M8 carries less current than M12.

Where M8 fits

M8 connectors show up on small proximity sensors, photo eyes, cylinder switches and compact valves, anywhere an M12 connector would be too big. The coupling is an M8 × 1 screw thread. Because the contacts are smaller, M8 is for signals and light loads, not for power feeds.

M8 coding chart

Coding What it’s for Pins Typical ratings on our parts
A Sensors and actuators, the everyday M8 3, 4, 6, 8 3-pin 60 V, 3 A; 4-pin 30 V, 3 A; 6- and 8-pin 30 V, 1 A
B Fieldbus and signal devices that need a different key than A 5 30 V, 3 A
D Compact 100 Mbit industrial Ethernet 4 30 V, 3 A; shielded cable
P A separate 4-pin key some devices use so a standard A-coded cable can’t be plugged in 4 30 V, 3 A

Ratings depend on wire size, jacket and temperature, so check the data sheet for the exact part.

M8 or M12?

  • Use M8 when the device has an M8 port or the space is too tight for M12. Most small sensors with 3 or 4 wires come with M8.
  • Use M12 for anything above a few amps, for longer runs out on a machine, and for Ethernet beyond short device connections.
  • Mixing them: an M8 sensor can plug into an M12 I/O port with an adapter cable. We list an M12 4-pin male to M8 4-pin female adapter cable.

How to pick an M8 cable in four steps

  1. Coding. Read it off the device or its manual. Most M8 sensors are A-coded.
  2. Pin count. 3-pin for a basic DC sensor (power, ground, signal), 4-pin when the sensor has a second output or IO-Link.
  3. Male or female. The sensor usually has a male port, so the cable end that plugs into it is female.
  4. Straight or right-angle, jacket and length. PUR stands up to oil and abrasion; PVC is fine for dry, fixed runs. Measure the run and add a little slack.

Mistakes we see

  1. Ordering an M8 cable for a load it can’t carry. Check the current on the data sheet; M8 is for signals.
  2. Mixing up front-mount and rear-mount receptacles. Check the panel thread and wall thickness on the data sheet before you drill.
  3. Assuming every 4-pin M8 is A-coded. D- and P-coded 4-pin parts look similar but won’t mate with A.
  4. Leaving unused ports open. Close them with a protective cap.

Shop M8

Every cable comes in 1, 2, 3, 5 or 10 m; other lengths, including lengths in feet, are built to order. See also the M12 coding guide.

Common questions

Will an M8 cable fit an M12 port? No. The threads and contact layouts are different. Use an M8-to-M12 adapter cable.

Snap or screw coupling? Our M8 parts use the screw coupling, which holds up to vibration better than snap-in versions.

Can you build an M8 cable that isn’t listed? Yes. Odd lengths, mixed ends and made-to-fit harnesses are what we do. Send a sketch or a part number for a quote.

IO-Link is a trademark of its owner, used here for identification only.

Secret Link