What Is the Standard M12 Connector Pinout?

What Is the Standard M12 Connector Pinout?

Author Penny
Published
Read Time 10 min read

A customer asks for a “standard M12 pinout.” It sounds like a simple request, but a pin diagram can be dangerously incomplete if it does not identify the coding, number of contacts, connector gender, viewing direction, and equipment function.

M12 describes a connector interface family, not one universal circuit.

There is no single functional M12 connector pinout for every M12 product. The physical contact positions are standardized within a selected coding and contact count, but the electrical function assigned to each contact still depends on the application and the equipment manufacturer.

For example, a common A-coded 4-pin sensor cable uses Pin 1/brown, Pin 2/white, Pin 3/blue, and Pin 4/black. That color-to-pin convention does not prove that every connected device gives the same job to Pin 2 or Pin 4. The device wiring diagram remains the final authority.

Front mating view of male and female M12 A-coded 4-pin connectors with pin numbers

Does Every M12 Connector Have the Same Pinout?

No. “M12” identifies the interface family; it does not specify one wiring diagram.

The IEC product standard covers M12 screw-locking connectors with multiple contact counts and configurations. It describes products from 2 to 17 ways and separates their mechanical and electrical requirements by application.1 The coding key then helps prevent connectors intended for different functions from being cross-mated.2

Before a pinout is useful, six questions must be answered:

  1. Is the connector A-, B-, D-, X-, S-, T-, K-, L-, or another coding?
  2. How many contacts does it have?
  3. Is it male or female?
  4. Is the drawing viewed from the mating face or the termination side?
  5. Is the circuit carrying sensor signals, industrial data, or power?
  6. What pin assignment is specified by the device manufacturer?

This distinction matters: contact position and circuit function are not the same thing. A standard may fix where “Pin 1” is located on a particular interface. The machine builder determines whether that pin carries supply voltage, a signal, data, protective earth, or another function—unless an application standard also defines it.

What Is a Common M12 A-Coded 4-Pin Pinout?

For a widely used A-coded 4-pin sensor cable, the common wire-color sequence is Pin 1 brown, Pin 2 white, Pin 3 blue, and Pin 4 black.

IEC 60947-5-2-based sensor connection documents show this familiar color assignment,3 while the IO-Link design guideline uses Pins 1, 3, and 4 for a typical Class A port and treats Pin 2 as an optional additional signal.4

Pin Common conductor color Common sensor / IO-Link use Important limitation
1 Brown L+ supply Confirm device voltage and drawing
2 White Optional or second signal Function varies by device
3 Blue L− / 0 V Confirm polarity before energizing
4 Black Switching signal or IO-Link C/Q Not universal across all equipment

This is a useful starting point, not permission to wire from memory. A pressure sensor, actuator, splitter, custom machine port, and proprietary device can assign functions differently.

An M12 5-pin A-coded connector adds another contact, but the extra pin does not automatically have one universal job. It may be used for an additional signal, functional earth, or a device-specific circuit. The equipment schematic must be checked.

Brown white blue and black conductors terminated to an M12 A-coded connector

Why Do Male and Female Pinout Drawings Look Mirrored?

A male and female connector can appear mirrored when both drawings are shown from their own mating faces.

This is one of the most common causes of field-wiring errors. A technician sees a correct online diagram, but the drawing is from the mating side while the connector in hand is being viewed from the solder or wiring side. Pin numbers then appear reversed.

Reliable connector drawings normally state a viewing direction such as:

  • Mating face view
  • Front view
  • Solder side
  • Wiring side
  • Termination side

Manufacturer drawings of M12 receptacles often provide separate face views and pin assignments precisely because the viewpoint matters.5

At NITAI, when a customer sends us a hand-marked wiring image, we do not copy it directly into production. We first label:

  • connector 1 and connector 2;
  • male and female;
  • mating view and wiring view;
  • Pin 1 orientation relative to the keyway;
  • conductor color and required end-to-end continuity.

Only then do we convert it into a production wiring table.

M12 male and female mating-face and wiring-side views

A safer way to describe custom wiring

Instead of writing “left contact to red wire,” specify:

End Coding / gender Pin number Conductor Opposite-end destination
End A M12 A-coded male 1 Brown End B Pin 1
End A M12 A-coded male 2 White End B Pin 2
End A M12 A-coded male 3 Blue End B Pin 3
End A M12 A-coded male 4 Black End B Pin 4

That format removes the ambiguity created by screen orientation.

Which Parts of the M12 Pin Configuration Are Standardized?

Once the coding, contact count, and interface are selected, the mating geometry and contact arrangement are not free-form.

This is the part that often causes confusion. We say there is no universal functional pinout, but that does not mean a standard connector face can be rearranged to any pattern.

The standard interface controls items such as:

  • keyway position;
  • contact arrangement;
  • contact numbering;
  • mating dimensions;
  • mechanical compatibility;
  • coding that prevents incorrect mating.

A useful example came from a recent sample project—not an M12 order, but an M8 6-pin connector with the same practical lesson. The customer bought a standard sample and later found it would not fit the holes in their PCB. The bottom three PCB holes had been designed in a straight row, while the connector used the standard 6-pin contact pattern.

The customer asked whether we could move the contacts. For that standard interface, the answer was no: changing the mating or PCB contact arrangement would stop it from being the standard product they selected. The correct solution was to revise the PCB footprint to the specified connector drawing.

Caliper and engineering drawing used to verify a PCB connector footprint

The lesson is simple: custom cable wiring is possible; arbitrary changes to a standardized mating pattern are not. Before releasing a PCB, always obtain the exact manufacturer drawing and verify the footprint, orientation, mounting face, and tolerances.

How Do D-Coded and X-Coded Pinouts Differ?

D-coded and X-coded connectors use application-specific Ethernet arrangements and must not be wired as though they were A-coded sensor connectors.

D-coded M12 Ethernet commonly uses four contacts and two data pairs for 100BASE-TX industrial networks. PROFINET guidance specifies the D-coded M12 interface for rugged 4-wire Ethernet connections and emphasizes correct shield termination.6

X-coded M12 uses eight contacts divided into four pairs. IEC 61076-2-109 addresses this M12 interface for data frequencies up to 500 MHz,7 and commercial systems use it for Category 6A and transmission up to 10 Gbps.8

Coding Common role Typical contacts Do not assume
A-coded Sensors, actuators, general signals 3, 4, 5 and others Ethernet pair assignment
D-coded 100 Mbps industrial Ethernet 4 A-coded sensor wiring
X-coded High-speed industrial Ethernet 8 Any ordinary 8-core cable will deliver 10 Gbps

The coding key prevents direct interconnection between unlike interfaces. If a customer asks us to make an adapter between different connector families, we also verify whether an electrical conversion—not merely a physical cable—is required.

What Do We Confirm Before Making an M12 Cable?

Before we quote or build, we convert the customer’s request into a controlled connector-and-wiring specification.

From the inquiries we receive, “M12 4-pin cable, two meters” is one of the most common incomplete descriptions. Our follow-up is usually:

  1. Send a clear front-face photo or existing part number.
  2. Confirm coding and number of contacts.
  3. Confirm male/female at each end.
  4. State the viewing direction of every pin diagram.
  5. Identify the connected device and application.
  6. Provide the original equipment wiring drawing if available.
  7. Confirm straight-through or custom cross-wiring.
  8. Confirm shield connection, cable length, jacket, and environmental needs.

For standard sensor-cable requirements, our M12 connector range provides a starting point. A customer who already knows they need a four-contact assembly can also review our M12 4-pin connector options, but the pin assignment still has to be confirmed before production.

Approved M12 cable pin-to-pin wiring table and continuity test

Our sample validation sequence

We normally recommend checking a sample against the real device before volume production:

  • physical mating and locking;
  • pin-to-pin continuity;
  • insulation and short-circuit check;
  • power-up on the intended device;
  • communication or signal test;
  • cable exit and bending clearance;
  • final drawing approval.

This is especially important when a customer has designed the PCB, supplies only a photograph, or requests non-straight-through wiring.

Frequently Asked Questions

Is Pin 1 always brown on an M12 connector?

Pin 1 is commonly connected to brown in standard sensor cordsets, but custom cable colors and device assignments exist. Check the cable drawing and device manual.

Is an M12 4-pin pinout always A-coded?

No. A-coded and D-coded products can both have four contacts, but their keying and applications differ.

Can NITAI make a custom pin-to-pin wiring arrangement?

Yes, many cable assemblies can use custom end-to-end wiring. The standardized mating-face geometry and keying, however, cannot simply be rearranged.

How can I tell whether a pinout drawing is front or rear view?

Look for a note such as “mating face,” “front view,” or “wiring side.” If it is missing, ask the drawing owner before wiring.

Can I connect male Pin 1 directly to female Pin 1?

Often, but not automatically. Confirm the specified continuity table. A crossover, hybrid assembly, or proprietary device may require another assignment.

What information should I send for a quotation?

Send coding, pin count, gender, connector form, cable length, jacket material, shield requirement, pin assignment, quantity, and the device drawing or existing part number. If any item is unclear, send us the photos and application details.

Conclusion

The safest answer to “What is the standard M12 connector pinout?” is two-part:

  1. The selected M12 coding and pin count have a standardized mechanical contact arrangement.
  2. The electrical function of those contacts must be confirmed for the actual device and application.

Do not wire from an unlabeled internet image. Confirm the coding, pin count, gender, viewing direction, and equipment schematic—and verify the sample on the real device before releasing volume production.

References


  1. [IEC 61076-2-101:2024](https://webstore.iec.ch/en/publication/77773) — Scope and contact-count range for M12 screw-locking circular connectors. It defines the connector family, not one universal device circuit.

  2. [IEC 61076-2-101 preview](https://elstandard.se/documents/preview/303401) — Explains M12 coding and the role of mechanical keys in preventing cross-mating.

  3. [SMC M8/M12 Connector Specifications](https://www.smcworld.com/catalog/en/directional/PCA-EX9-EX500-E/6-1-1-p0907-0927-pca_en/data/6-1-1-p0907-0927-pca_en.pdf) — Supports the common brown/white/blue/black assignment for Pins 1–4.

  4. [IO-Link Design Guideline](https://io-link.com/fileadmin/user_upload/Downloads/About_IO-Link/IO-Link_Design_Guideline_eng_2018.pdf) — Supports the Class A use of Pins 1, 3, and 4 and the optional role of Pin 2.

  5. [Lumberg Automation M12 Receptacle Data](https://www.farnell.com/datasheets/1732921.pdf) — Provides mating-face diagrams, numbered contacts, and examples of M12 pin assignments.

  6. [PROFINET Cabling and Interconnection Technology Guideline](https://www.profibus.com/fileadmin/media/downloadsection/installation_guide/PN-Cabling-Guide_2252_V53_May23.pdf) — Supports D-coded four-contact industrial Ethernet wiring and shielding practice.

  7. [IEC 61076-2-109 preview](https://elstandard.se/documents/preview/1478701) — Defines the M12 X-coded data connector family and its frequency scope.

  8. [Phoenix Contact M12 Ethernet Connectors](https://www.phoenixcontact.com/en-us/cat/m12-ethernet-connectors-1592) — Supports the practical distinction between D-coded 100 Mbps and X-coded 10 Gbps product systems.

Leave a Reply

Your email address will not be published. Required fields are marked *

NITAI Electronics · Dongguan, China

Ready to Source Industrial Connectivity Products?

NITAI manufactures terminal blocks, M8/M12 waterproof connectors and industrial distribution modules for global OEMs, distributors and automation customers.