If you are winding coils to build a DIY linear actuator, a custom relay, or a magnetic lock, the fundamental magnet formula you need is the solenoid magnetic field equation. The direct answer for the magnetic flux density (B) inside an ideal solenoid is:
B = μ0 × μr × (N / L) × I
This formula tells you exactly how strong your electromagnet will be in Tesla, based on your wire turns, coil length, core material, and drive current. But a formula is only as good as its assumptions. Below, we break down every variable, show you how to rearrange it for practical coil design, and walk through bench-tested examples with strict unit tracking.
The Core Magnet Formula and Symbol Definitions
To use the magnet formula correctly, you must understand the physical limits of each variable. Here is the complete spec sheet for the solenoid B-field equation.
| Symbol | Quantity | SI Unit | Typical DIY / Bench Range |
|---|---|---|---|
| B | Magnetic Flux Density | Tesla (T) | 0.01 T to 1.2 T |
| μ0 | Vacuum Permeability (Constant) | T·m/A | 4π × 10-7 (approx 1.2566 × 10-6) |
| μr | Relative Permeability of Core | Dimensionless | 1 (air), 1000-4000 (silicon steel), 10,000+ (pure iron) |
| N | Total Number of Wire Turns | Dimensionless (count) | 50 to 5,000 turns |
| L | Length of the Solenoid Coil | Meters (m) | 0.01 m to 0.5 m |
| I | Current Through the Wire | Amperes (A) | 0.1 A to 10 A |
Rearranged Forms for Coil Design
On the bench, you rarely solve for B directly. Usually, you have a target magnetic field (e.g., you need 0.5 T to pull a specific steel armature) and you need to figure out your winding parameters. Here are the rearranged forms solving for each design variable:
- Solve for Current (I):
I = (B × L) / (μ0 × μr × N)
Use when: You have a fixed coil and core, and need to set your power supply current limit. - Solve for Turns (N):
N = (B × L) / (μ0 × μr × I)
Use when: You know your power supply max current and need to calculate how many winds to put on the bobbin. - Solve for Length (L):
L = (μ0 × μr × N × I) / B
Use when: You are designing the physical bobbin dimensions for a pre-determined wire spool and current.
Assumptions, Limits, and Unit Traps
The magnet formula is an idealization derived from Ampere's Law. If you ignore its boundaries, your simulation will fail on the workbench.
When the Formula Applies (and When It Doesn't)
This formula assumes an infinitely long solenoid. In practice, it is highly accurate if the coil length (L) is at least 10 times greater than the coil's diameter. It calculates the field at the center of the coil. At the ends of the solenoid, the magnetic field drops to roughly half the calculated value (B/2). If you are building a short, fat coil (like a pancake coil), this formula will overestimate your center field strength, and you must use elliptic integrals or finite element analysis (FEA) instead.
The Unit Mistakes That Break Your Math
- Centimeters vs. Meters: The #1 killer of DIY coil math. The permeability constant (μ0) is in Tesla-meters per Ampere. If your coil is 5 cm long, you must input 0.05 m. Plugging in '5' will yield a result 100 times smaller than reality.
- Gauss vs. Tesla: Hobbyist gaussmeters often read in Gauss (G). The SI formula outputs Tesla (T). Remember: 1 Tesla = 10,000 Gauss. If your meter reads 450 G, your B value for the formula is 0.045 T.
Realistic Answer Magnitudes
How do you know if your calculated answer makes physical sense? Use these benchmarks:
- Earth's Magnetic Field: ~0.00005 T (50 μT)
- Standard Fridge Magnet: ~0.005 T (5 mT)
- DIY Lifting Electromagnet: 0.2 T to 0.8 T
- Core Saturation Limit: ~1.5 T to 2.0 T (Beyond this, μr crashes toward 1, and pumping more current just generates heat, not magnetism).
- Hospital MRI Machine: 1.5 T to 3.0 T
The magnet formula gives you the magnetic target; Ohm's law and AWG ampacity tables tell you if you'll start a fire. I once saw a hobbyist wind 2,000 turns of 30 AWG wire, calculate they needed 5 amps to hit 1 Tesla, and immediately melt the coil. 30 AWG wire maxes out around 0.86A for chassis wiring. Always cross-reference your calculated I with a wire ampacity chart before applying power.
Worked Examples with Unit Tracking
Let's run two real-world scenarios, tracking every unit to ensure dimensional consistency.
Problem 1: Air-Core Coil Field Strength
Scenario: You wind 500 turns of enameled copper wire around a 20 cm long PVC tube (air core). You drive it with 2.0 Amps of DC current. What is the magnetic flux density in the center?
- Identify Knowns: N = 500, L = 0.20 m, I = 2.0 A, μr = 1 (air), μ0 = 1.2566 × 10-6 T·m/A.
- Setup Equation: B = (1.2566 × 10-6 T·m/A) × 1 × (500 / 0.20 m) × 2.0 A
- Cancel Units: The 'm' in the denominator of μ0 cancels the 'm' in L. The 'A' in the denominator cancels the 'A' in I. We are left with Tesla (T).
- Calculate: B = 1.2566 × 10-6 × 2500 × 2.0
- Result: B = 0.006283 T (or 6.28 mT / 62.8 Gauss).
Problem 2: Sizing Current for an Iron-Core Actuator
Scenario: You need a magnetic field of 0.8 T to pull a steel latch. You have a 10 cm long silicon steel core (μr = 2000) and you've wound 1,000 turns. What current do you need?
- Identify Knowns: B = 0.8 T, L = 0.10 m, N = 1000, μr = 2000, μ0 = 1.2566 × 10-6 T·m/A.
- Setup Equation: I = (B × L) / (μ0 × μr × N)
- Plug in Values: I = (0.8 T × 0.10 m) / (1.2566 × 10-6 T·m/A × 2000 × 1000)
- Simplify Denominator: 1.2566 × 10-6 × 2,000,000 = 2.5132 T·m/A
- Calculate: I = 0.08 / 2.5132
- Result: I = 0.0318 A (or 31.8 mA).
Takeaway: This demonstrates the massive advantage of a ferromagnetic core. Achieving 0.8 T with an air core would require over 63 Amps, but the steel core drops the requirement to a safe, easily drivable 31.8 mA.
The Secondary Magnet Formula: Pulling Force
Knowing the Tesla rating is great for physics, but makers usually want to know: how much weight can this lift? To find the pulling force (F) of an electromagnet against a flat steel surface, use Maxwell's pulling force formula:
F = (B2 × A) / (2 × μ0)
Where F is Force in Newtons, B is the flux density in Tesla, A is the cross-sectional area of the core face in square meters (m2), and μ0 is the vacuum permeability.
Pro-Tip: To convert Newtons to kilograms of lifting force, divide the result by 9.81 m/s2. According to Georgia State University's HyperPhysics, this formula assumes perfect, flush contact between the magnet and the armature; even a 0.1mm air gap from rust or paint will drastically reduce the real-world force.
Frequently Asked Questions
How does the magnet formula change for a neodymium permanent magnet?
The solenoid formula (B = μ0μr(N/L)I) does not apply to permanent magnets because there is no coil (N) or drive current (I). Permanent magnets are characterized by their intrinsic Remanence (Br) and Coercivity (Hc) found on the manufacturer's B-H curve datasheet. For a standard N52 neodymium magnet, the surface field is typically fixed around 1.2 to 1.4 Tesla. To calculate the pull force of a permanent magnet, you still use the Maxwell force equation (F = B2A / 2μ0), but you must account for the magnetic circuit's reluctance and air gaps.
Why does my calculated magnet formula result not match my gaussmeter reading?
If your math says 0.5 T but your gaussmeter reads 0.2 T, you are likely hitting core saturation. The formula assumes μr is a constant linear multiplier. In reality, as the magnetic domains in iron or steel align, μr peaks and then violently drops off. For standard electrical steel, saturation begins around 1.2 T to 1.5 T. Once saturated, the core acts like air (μr ≈ 1), and additional current only generates I2R heat. Furthermore, if your coil is short relative to its diameter, the "infinite solenoid" assumption fails, and edge effects reduce the center field strength.
Can I use the magnet formula for AC electromagnets and transformers?
Yes, but you must use RMS (Root Mean Square) current for I, and the resulting B will be the peak AC magnetic field. However, for AC applications, you must also calculate eddy current losses and hysteresis losses. This is why AC electromagnets and transformers use laminated silicon steel sheets rather than solid iron cores. If you apply the DC formula to a solid iron core on 60Hz AC, the core will rapidly overheat and melt the winding insulation due to induced eddy currents, a phenomenon detailed in standard electromagnetic theory guides.
What is the maximum Tesla limit before the iron core saturates?
It depends entirely on the alloy. Pure iron saturates around 2.1 Tesla. Standard silicon electrical steel (used in transformers and motor laminations) saturates between 1.5 T and 1.8 T. Ferrite cores (used in high-frequency SMPS transformers) saturate much earlier, typically around 0.3 T to 0.5 T. Always check the specific B-H curve provided by the core manufacturer (like Ferroxcube or TDK) before finalizing your coil turns and current limits.






