Write down the gap you need, then pick the parts that produce it. The gap equals the female body height plus the male pin length, minus the engagement depth. If the result is not a standard combination, change the male pin length, not the female body, because pin length is a cutting operation and body height is a mold.

Most stacking problems come from working in the other order: pick two catalog parts, assemble them, discover the gap is 1.2 mm off, and then ask whether the enclosure can absorb it.

The formula, with real numbers

Part Value
Female header body height 8.5 mm
Male header pin length (overall) 11.0 mm
Male pin length below its own body 8.5 mm
Engagement into the socket 3.0 mm
Resulting board gap ~6.0 mm

The visible gap is what is left of the male pin after it has entered the socket, plus the space taken by the male body. Change the male pin to 13 mm and the gap grows by 2 mm without touching the female part.

Engagement is not optional

A 2.54 mm socket needs about 3 mm of pin inside it for the contact spring to sit on a stable part of the pin. Less than that and contact resistance becomes sensitive to vibration and to how far the assembler pushed.

If your gap calculation leaves 2 mm of engagement, the assembly will pass on the bench and fail on the shaker. State the mated height on the drawing and let the supplier hold it.

Three ways to hit the same gap

  • Standard on standard: 8.5 mm body with an 11 mm male header gives about 6 mm. Cheapest, no tooling.
  • Cut the pins: the same female part with a longer male header, cut to length. Adds a cutting step, holds the gap precisely.
  • Custom body: a non-standard female height. This is a mold, 25–30 days, and only worth it above large volumes.

The tolerance chain

The gap is a stack of five tolerances: female body height, male body height, pin length, PCB thickness twice, and the engagement. Each is typically ±0.1 to ±0.2 mm. Summed, the gap can move ±0.5 mm before anything is out of specification.

If the enclosure only allows ±0.2 mm, the connector cannot hold it. Add a mechanical spacer or a standoff that sets the gap, and let the header only carry the electrical connection. This is standard practice in instruments with tight enclosures.

Connectors are not structural

A stacked pair of headers will hold two boards apart, but the solder joints are carrying the load. If the assembly is dropped, or if someone presses on the top board, the load lands on 2×10 joints.

Use standoffs at the corners for anything bigger than a small module. Keep the header for signals and let the hardware take the force.

Can I stack more than two boards?

Yes, with a pass-through arrangement on the middle boards: female on top, male underneath, aligned. Each board adds its thickness to the tolerance chain, so three boards is usually the practical limit without standoffs.

Does the gap change the current rating?

No. It changes the engagement length, which changes contact stability. A short engagement behaves like a lower-force contact, which shows up as resistance drift rather than a rating change.

Is a 5.0 mm body enough for two boards with parts underneath?

Only if the tallest part under the top board is below about 3 mm. Measure the tallest component, add 1 mm, and compare with the gap. See the three body heights compared.

Send the gap, the board thicknesses and the tallest component between the boards, and we will give you the exact pair that lands inside your tolerance. Female and male parts are in the board-to-board range.