DIN rail length planner

List what goes on the rail, add end stops and some spare room, and the planner adds it up and draws the plan as a schematic. It is an estimate for planning a cut length, not a layout check.

1 · Modules on the rail

Enter the module width from your datasheet. The starting 18 mm is an example. It converts rows given in modules, and it also sets the "room for more modules" estimate.

2 · End stops
3 · Spare space
4 · Rail you have (optional)

The starting values are examples. Replace them with the widths printed in each datasheet. Supported resolution: lengths in mm to 0.01 mm, widths in modules and percentages to 0.1, counts as whole numbers.

Estimated rail length

290 mm Estimate

Modules
225 mm
End stops
20 mm
Spare
45 mm
In metres
0.2900 m

The spare space is 45 mm (room for about 2 more modules of 18 mm).

Schematic drawing. Block lengths along the rail are proportional to the widths you entered; heights and shapes are not. Blocks are drawn in the order entered, with the end stops split between the two ends. The ticks show the scale in mm or m.

  • Module
  • End stop
  • Spare space
  • Past the end of the rail you have

How the estimate is worked out

rail length = Σ (width × how many) + end stops × end stop width + spare

  • A width given in modules is converted with width in mm = modules × module width, using the module width you set (18 mm is only the starting example).
  • Spare given as a percentage is spare = Σ module widths × percentage ÷ 100, where "per cent" means one part in a hundred (SP 330 - Section 5, NIST). End stops are not included in that base.
  • With a rail length entered, left over = rail you have − rail length. Room for more modules is floor(left over ÷ module width), rounded down to whole modules. With no rail length entered, it is floor(spare ÷ module width).
  • Metres are the millimetre total divided by 1,000, because "milli" means one thousandth (The International System of Units (SI): Prefixes, BIPM). The mm and m figures are both worked from the same total rounded to 0.1 mm.

Input resolution and limits

  • Lengths in mm can have up to 2 decimal places, so the smallest length is 0.01 mm. Widths in modules and percentages can have 1 decimal place. How many, and the number of end stops, are whole numbers. A figure with more decimal places is refused rather than rounded.
  • The sums are exact (done in whole units of one millionth of a millimetre), so a plan that exactly fills the rail you have is reported as fitting, and a plan that is a hair too long is reported as short.
  • Limits: module width up to 100 mm; one row up to 5,000 mm or 200 modules; how many from 1 to 500; 0 to 20 end stops of up to 100 mm each; spare up to 300 % or 50,000 mm; rail and total up to 100 m.

Assumptions

  • Modules sit side by side with no gaps. If a datasheet asks for clearance beside a device, add it to that device's width or to the spare space.
  • Widths are the ones you type. The planner holds no product data; the starting values are examples only.
  • End stops are split between the two ends of the rail in the drawing.
  • The result is a length along the rail only. It does not check rail depth, mounting screws, wiring ducts, heat, enclosure size or the load on the rail.
  • The drawing is a schematic: lengths along the rail are proportional, heights and shapes are not. Results are rounded to 0.1 mm for display.

Sources named on this page

The planner takes no figure from any standard or catalogue. Every number in the sum is one you enter. These are named so you can check the rail and device sizes against the documents that apply to your parts: