Use a matched header and socket pair when the gap is a catalog value (typically 5, 8, 11 or 14 mm). Cut the male pins to length when the gap is between catalog values. Add a mechanical spacer when the tolerance is tighter than ±0.3 mm. Doing all three at once is how you get a stack that cannot be assembled.

Board-to-board spacing looks like a connector choice and is really a tolerance question. The connector is one element in a chain that includes two board thicknesses, the solder joint, and the housing.

The three approaches

Approach Tolerance Tooling Best for
Catalog pair ±0.3 mm None Standard gaps, quick designs
Cut pins ±0.2 mm None, but a cutting step Odd gaps, prototypes
Spacer plus header ±0.1 mm Spacer machining Tight mechanical stacks

Why catalog pairs have loose tolerance

Each element contributes: the female body height (±0.15 mm), the male body (±0.15 mm), the pin length (±0.2 mm), the two board thicknesses (±0.1 mm each), and the engagement depth, which varies with how hard the assembler pushes.

Summed in the worst case, a nominal 8 mm gap can be 7.4–8.6 mm. If the enclosure needs 8 ± 0.2, the connector cannot deliver it and the enclosure will be redesigned late.

When the spacer is the answer

A machined or molded spacer at each corner sets the gap, and the header only carries signals. The spacer takes the compression load, the tolerance becomes the spacer’s, and the connector floats within its engagement range.

This is standard in instruments and in anything with a display parallel to a main board. It costs a spacer and four screws, and it removes the connector from the tolerance chain entirely.

What to write on the drawing

  • Mated height, not body height, with the tolerance.
  • The two board thicknesses assumed.
  • Whether a spacer carries the load.
  • The minimum engagement you will accept, so the supplier can check it.

Can I use two headers to set the gap?

Yes, and it is common for large boards: two connectors share the load and keep the boards parallel. Both must be in the same tolerance band or the boards will rock.

Does the gap affect signal integrity?

At these speeds and pitches, no. The gap matters for the mechanical stack, not for the electrical performance of a 2.54 mm passive connector.

What is the smallest usable gap?

About 3.5 mm with a 5.0 mm body, and that assumes no components on the facing surfaces. Below that, the boards need cut-outs or a flex connection.

Send the gap with its tolerance and the two board thicknesses, and we will tell you which of the three approaches holds it. Related: working out the gap and the three body heights.