Posted in

How to measure the size of a Din Rail Enclosure?

If you’ve ever spent time wiring a control panel, automation system, or industrial electrical setup, you know that Din rail enclosures are the unsung heroes of the space. They tuck delicate circuit boards, relays, terminal blocks, and power supplies out of harm’s way, while keeping everything organized and accessible. But here’s the thing: a wrong-sized Din rail enclosure doesn’t just waste space—it can lead to sloppy wiring, overheating, or even equipment failure as components shift or get damaged. As a Din rail enclosures supplier who’s worked with hundreds of electricians, automation technicians, and industrial engineers over the past decade, I’ve seen far too many projects derail because someone guessed at the size of their enclosure instead of measuring it properly. Today, I’m breaking down the process of measuring Din rail enclosures like a pro, no guesswork required. Din Rail Enclosures

First, let’s get one basic term straight for anyone new to this: what is a Din rail? It’s that standardized metal rail (usually made of steel or aluminum) that you slot components into, and almost all enclosures are designed to fit these rails, which follow international standards like IEC 60715. That means you don’t have to worry about custom rail sizes—all standard Din rails are either 35mm wide (the most common for nearly all industrial components) or 15mm for smaller, lightweight parts like terminal blocks. The enclosure’s size doesn’t just mean how long or tall it is; it refers to the three key dimensions that matter: width along the Din rail, depth from the front of the rail to the back of the enclosure, and height from bottom to top. Get even one of these wrong, and you’ll end up with an enclosure that’s too tight, too loose, or impossible to mount.

Let’s start with the most critical measurement, and the one most people mess up first: the length along the Din rail. This is not just the total length of all your components lined up side by side, but it includes the space between each component and a little extra room at the ends. Why? Because when you slide components onto a Din rail, you need a small gap to tighten the rail’s locking clips and to make sure you can pull components off later for maintenance. I once had a customer come to me with a setup of 12 terminal blocks and a small relay, claiming he only needed 150mm of rail length. He measured each component’s width at exactly 12.5mm each, so 12 x 12.5 = 150mm, right? Wrong. The locking tabs on either end of the rail take up about 5mm each, and each component needs 1mm of space on either side to slide in and out easily. That extra 24mm (12 components x 2mm each) plus the 10mm for the end tabs brought his total required rail length to 184mm, not 150mm. He ordered the smaller enclosure, had to cut components to fit, and called me back a week later to swap it for a longer one—costing him time and extra shipping. So rule number one for rail length: add 20mm for end clearance, plus 1-2mm of space between every component. Don’t just add up the exact widths of your parts.

Next up: depth. This is the measurement that trips up people even more often than rail length. Depth is how far the enclosure sticks out from the Din rail, from the back of the rail mount to the front edge of the enclosure, and it has to fit two things: your components themselves and the wiring that comes off them. I’ve had engineers bring me designs where their power supply is 80mm deep, so they pick an enclosure with 80mm of depth, only to find that the wiring lugs and cables stick out an extra 20mm from the back of the power supply, so they can’t close the enclosure’s back panel. Or the front of the enclosure hits the control panel door because there’s not enough space between the component and the door to open it fully. Here’s how to measure depth correctly: take the deepest component in your setup (usually a power supply, contactor, or large relay) and measure its depth from its front edge to its back edge (the side that sits against the Din rail). Then, add at least 25mm for wiring and cable slack at the back. If you have any components that stick out from the front of the enclosure—like a display, a switch, or a terminal block with a protruding lever—measure that too, and make sure your enclosure’s front edge will sit back far enough so those parts don’t hit the control panel door. Another pro tip: if you’re working in a tight space, look for enclosures with recessed door edges or slim profiles, but never skimp on that extra 25mm for wiring—crimping cables behind an enclosure is a recipe for pinched wires and electrical shorts.

The third dimension, height, is the easiest to get right, but also the most overlooked if you’re working in a pre-cut control panel. Height is how tall the enclosure is from its bottom mounting edge to its top edge. For most standard setups, if you’re mounting components that sit flat on the Din rail (no protruding tops like large circuit breakers), you just need to make sure the enclosure’s internal height is at least as tall as the tallest component. But if your control panel has limited vertical space, you also have to account for the mounting brackets. Some enclosures require 5mm of space above and below the Din rail to attach the mounting feet or wall brackets. If you’re mounting multiple enclosures next to each other, you’ll also need to add 10mm of clearance between each to allow for air flow and to make wiring easier between enclosures. I once worked with a customer who mounted four small enclosures in a 100mm vertical slot, and she forgot that each needed 5mm of top and bottom clearance. She ended up forcing the enclosures into the slot, which bent the Din rail and broke three of the terminal blocks inside. So measure your available vertical space, subtract 10mm per enclosure for top and bottom clearance, and use that to calculate your height.

Wait, but what if you’re not just using standard Din rail components? What if you have a custom circuit board, a sensor, or a HMI touchscreen that doesn’t mount on a standard Din rail? That’s a common scenario for smaller automation projects, and the measurement process changes a little. For non-Din components, you’ll need to make a mockup of your setup first—use cardboard or foam cut to the exact size of each part, and arrange them on a standard Din rail to simulate the space they’ll take up. That way, you can test the rail length, depth, and height without buying expensive parts. For example, if you have a custom circuit board that’s 50mm wide, you’ll need to make sure your mockup shows how much space it needs next to a standard terminal block, so you don’t end up cramming it in. Also, if you’re adding any accessories like terminal covers, cable glands, or circuit breaker add-ons, add their dimensions to your mockup too—cable glands alone can add 10-15mm to the depth if they’re mounted on the back or side of the enclosure.

Another important factor I’ve learned over the years is environmental conditions. If your enclosure is going to be mounted outdoors, in a dusty factory floor, or near a water spray, you’ll need to account for the thickness of the enclosure’s IP-rated gasket when measuring depth. A waterproof IP66 enclosure has a rubber gasket around the door that adds an extra 3mm to the depth, so if you calculated your depth at 100mm for components, you’ll need an enclosure that’s at least 103mm deep to account for that gasket. If you skip that, the door won’t close properly, and your IP rating will be useless—meaning dust or water can get inside and damage your components. For indoor setups, gasket thickness is less of a concern, but you might want to leave a little extra depth for future expansions. Most of my customers tell me they wish they’d ordered a slightly larger enclosure to add a relay or sensor a year down the line, instead of having to rework their entire control panel.

Let’s walk through a real example to make this concrete. Say you’re building a small solar power monitoring system, and your components are: one 100mm-long power supply, eight 12mm-wide terminal blocks, and one 40mm-wide data logger. First, calculate the rail length: add the exact component widths (100 + (8 x12) +40 = 236mm), then add 20mm for end clearance, plus 2mm of space between each part. There are a total of 9 gaps between components (between the power supply and first terminal, between each terminal, between last terminal and data logger), so that’s 18mm. Total rail length: 236 + 20 +18 = 274mm. Round up to the nearest standard Din rail length (standard lengths are 250mm, 300mm, 350mm) so you’ll go with 300mm. Now depth: your power supply is 70mm deep, and you need 25mm for wiring, so that’s 95mm, plus if it’s going to be outdoors, add 3mm for the gasket, so 98mm. Round up to 100mm depth standard. Height: your tallest component is 50mm, so add 10mm for top and bottom mounting clearance, so 60mm total height. That gives you an enclosure that’s roughly 300mm long, 100mm deep, 60mm tall—perfect for that solar monitoring setup.

One last mistake I see all the time is forgetting to account for Din rail type. Wait a second—there are two main types of Din rails: Type A (also called standard) is 35mm wide with a 15mm high profile, and Type B is 35mm wide with a 7.5mm high profile, used for smaller, lighter components. Make sure your enclosure is designed for the type of Din rail you’re using, because some enclosures only fit one type. If you have Type B rails and order an enclosure for Type A, the rail will be too narrow and the components won’t lock in securely, leading to loose connections and potential shorts. Always check the product specifications from your enclosure supplier to confirm the rail type compatibility.

At the end of the day, measuring a Din rail enclosure isn’t rocket science, but it does require attention to detail and a little forethought. The biggest mistake people make is only measuring their components without accounting for extra space for wiring, end clearance, and future expansions. As a Din rail enclosures supplier, I’d rather help a customer pick the right size the first time than deal with returns and frustrated technicians scrambling to fix a wrong fit. If you’re working on a project and aren’t sure about your measurements, don’t hesitate to reach out. We’ve helped electricians and engineers across industries from automotive to renewable energy get their enclosure sizes right, and we’re always happy to walk through your setup step by step. Whether you need a small 3-module enclosure for a hobby project or a large modular enclosure for a full automation line, we have the sizes and customization options to fit your needs. Don’t let a bad measurement derail your project—let’s make sure your components are safe, organized, and properly housed from day one.

Three Phase Load Center References
IEC 60715: Standard for Mounting Rails for Electrical Equipment
National Electrical Manufacturers Association (NEMA) Enclosure Standards
IP Code Definitions for Enclosures, International Electrotechnical Commission (IEC) 60529
Industrial Automation Control Panel Design Best Practices, International Society of Automation (ISA)


Zhejiang Youtai Electrical Co., Ltd.
We are one of the most experienced din rail enclosures manufacturers and suppliers in China. With a professional production team, we are able to meet the needs of the majority of our customers. Please rest assured to wholesale customized din rail enclosures from our factory. Contact us for more cheap products.
Address: No.790, Nanming Rd., Shuige Industrial Zone, Lishui, Zhejiang, China
E-mail: sale@ultech.cc
WebSite: https://www.zhejiangyoutai.com/