If you are winding a custom electromagnet, designing an inductor, or debugging an industrial contactor that refuses to pull in, you need to know exactly how much magnetic flux your coil is generating. The magnetic field of coil formula (specifically for a long solenoid) is the foundational math behind every electromagnetic device on your bench.

The direct answer for the magnetic flux density (B) inside a long, tightly wound coil is B = μ · n · I, where μ is the core permeability, n is the turn density (turns per meter), and I is the current in amperes. Below, we break down every variable, map out real-world magnitudes, and run through bench-tested calculations with strict unit tracking.

The Core Formula and Symbol Definitions

The standard formula for the magnetic field inside an ideal, infinitely long solenoid is derived from Ampère's Law. In practical electrical engineering, we expand the permeability term to account for the core material. The working formula is:

B = μ0 · μr · (N / L) · I

Here is the complete spec-sheet table defining every symbol, its SI unit, and what it physically represents on the workbench.

Symbol Name SI Unit Practical Context & Typical Range
B Magnetic Flux Density Tesla (T) The actual magnetic field strength. Earth is ~0.00005 T; a strong neodymium magnet is ~1.2 T.
μ0 Permeability of Free Space T·m/A A physical constant: exactly 4π × 10-7 (approx. 1.2566 × 10-6) T·m/A.
μr Relative Permeability Dimensionless Core material multiplier. Air = 1. Ferrite = 20-5000. Silicon steel = 4000-10,000.
n Turn Density m-1 (turns/m) Calculated as N / L. How tightly the wire is packed along the coil's axis.
N Total Number of Turns Dimensionless Total loops of wire. Dictates the DC resistance and wire gauge requirements.
L Coil Length Meters (m) The physical length of the wound section, not the total wire length.
I Current Amperes (A) DC current flowing through the wire. Limited by wire ampacity and thermal dissipation.

Real-World Coil Parameters and Field Magnitudes

To develop an intuition for what a "realistic" answer looks like, you need to see the formula applied to actual hardware. A common mistake hobbyists make is expecting air-core coils to generate massive fields; without a ferromagnetic core, you are limited by the μ0 constant. The table below maps real-world electromagnetic devices to their typical parameters and resulting flux densities.

Application Core Material Typical μr Turn Density (n) Operating Current (I) Resulting B Field
12V Automotive Relay Soft Iron / Steel ~4,000 10,000 turns/m 0.15 A ~750 mT (0.75 T)
Industrial Contactor Silicon Steel Laminations ~6,000 4,000 turns/m 0.50 A ~1,500 mT (1.5 T)*
MRI Superconducting Magnet Air / Vacuum (No core) 1 50,000 turns/m 120.0 A ~7,500 mT (7.5 T)
DIY Scrap Electromagnet Mild Steel Bolt ~1,500 1,500 turns/m 2.00 A ~280 mT (0.28 T)
Lab Air-Core Inductor Plastic / Air 1 2,000 turns/m 3.00 A ~7.5 mT (0.0075 T)
*Note on Saturation: The 1.5 T value for the industrial contactor approaches the saturation limit of silicon steel. Once a core saturates, its effective μr plummets toward 1, and the linear formula breaks down. Always check the material's B-H curve for high-flux designs.

Rearranged Forms for Design Calculations

On the bench, you rarely solve for B directly. Usually, you have a target magnetic field (e.g., enough force to close a relay armature) and need to find the required current or turns. Here are the rearranged forms solving for each primary variable:

  • Solve for Current (I): I = B / (μ0 · μr · n)
    Use when: Sizing the power supply or current-limiting resistor for a target pull force.
  • Solve for Turn Density (n): n = B / (μ0 · μr · I)
    Use when: Determining how tightly you must wind the bobbin given a fixed current budget.
  • Solve for Total Turns (N): N = (B · L) / (μ0 · μr · I)
    Use when: Calculating the total wire length needed, which dictates your spool size and DC resistance.
  • Solve for Relative Permeability (μr): μr = B / (μ0 · n · I)
    Use when: Characterizing an unknown ferrite or iron core using a gaussmeter and a known test coil.

Worked Examples with Strict Unit Tracking

The most common reason coil calculations fail is sloppy unit tracking. The SI system demands meters, amperes, and teslas. Let's run two scenarios with explicit intermediate steps.

Problem 1: Air-Core Solenoid for a Lab Sensor

Scenario: You are building a calibration coil for a Hall-effect sensor. You wind 500 turns of 24 AWG magnet wire evenly over a 15 cm long PVC tube. You drive 2.5 A of DC current through it. What is the magnetic field at the center?

  1. Identify and convert variables to SI:
    • N = 500 turns
    • L = 15 cm = 0.15 m
    • I = 2.5 A
    • μr = 1 (Air/PVC core)
    • μ0 = 4π × 10-7 T·m/A ≈ 1.2566 × 10-6 T·m/A
  2. Calculate turn density (n):
    • n = N / L = 500 / 0.15 m = 3333.33 turns/m
  3. Apply the formula with unit cancellation:
    • B = (1.2566 × 10-6 T·m/A) × (1) × (3333.33 m-1) × (2.5 A)
    • The 'm' and 'A' units cancel out, leaving Teslas (T).
    • B = 1.2566 × 10-6 × 8333.325
    • B = 0.01047 T
  4. Convert to practical units:
    • 0.01047 T × 1000 = 10.47 mT (or 104.7 Gauss).

Problem 2: Sizing Current for an Iron-Core Relay

Scenario: You are reverse-engineering a 24V DC industrial relay. The core is silicon steel with an effective μr of 4,000. The coil is 4 cm long with 800 turns. You need a minimum flux density of 0.8 T to reliably pull in the armature against the spring tension. What current is required?

  1. Identify and convert variables to SI:
    • B = 0.8 T
    • μr = 4,000
    • N = 800 turns
    • L = 4 cm = 0.04 m
  2. Calculate absolute permeability (μ) and turn density (n):
    • μ = μ0 × μr = (1.2566 × 10-6) × 4000 = 0.0050264 T·m/A
    • n = 800 / 0.04 m = 20,000 turns/m
  3. Rearrange formula to solve for I:
    • I = B / (μ × n)
    • I = 0.8 T / (0.0050264 T·m/A × 20,000 m-1)
    • I = 0.8 / 100.528 A
    • I = 0.00795 A
  4. Convert to practical units:
    • 0.00795 A = 7.95 mA.

Bench Note: 7.95 mA is incredibly low, which is why relays use high-permeability cores and dense windings. In reality, you must also calculate the coil's DC resistance to ensure your 24V source can actually deliver this current without exceeding the wire's thermal limits.

Boundary Conditions, Core Saturation, and Unit Traps

The formula B = μ0 · μr · n · I is elegant, but it is an approximation that relies on strict physical assumptions. If you ignore these, your theoretical math will not match your gaussmeter readings.

When the Formula Applies (and When It Doesn't)

This formula assumes an ideal, infinitely long solenoid. In practice, it yields accurate results (within 5%) only if the coil's length is at least 10 times its radius (L > 10R). It also assumes the field is measured at the exact center of the coil; the field strength drops to roughly half at the physical ends of the solenoid.

If you are building a "short" or "pancake" coil where the length is comparable to or smaller than the diameter, this formula will massively overestimate your field. For short coils, you must apply the Nagaoka coefficient or use elliptic integrals to account for the fringing fields that leak out the sides before reaching the center. For precise short-coil modeling, reference the Georgia State University HyperPhysics solenoid derivations.

The Ferromagnetic Saturation Trap

The most dangerous assumption in the formula is that μr is a constant. For air, it is. For iron, steel, and ferrite, it is not. Ferromagnetic materials exhibit a non-linear B-H curve. As your B field increases, the magnetic domains in the core align. Once they are fully aligned, the core saturates.

For typical silicon electrical steel, saturation occurs around 1.5 T to 1.8 T. Once saturated, adding more current (I) or more turns (N) yields diminishing returns because the effective μr crashes from 4,000 down toward 1. If your calculation predicts 3.0 T in an iron core, your math is wrong; the physics of the material caps it at ~1.8 T, and the excess current just generates waste heat.

Unit Mistakes That Break the Math

When your calculated field is off by a factor of 100 or 10,000, you have almost certainly fallen victim to one of these unit traps:

  • Centimeters instead of Meters: The formula demands L in meters. If you plug in 15 cm as "15" instead of "0.15", your turn density n will be off by a factor of 100, and your final B field will be 100x too small.
  • Gauss vs. Tesla: Gaussmeters are common on the bench, but Gauss is a CGS unit, not SI. 1 Tesla = 10,000 Gauss. If your formula outputs 0.05 T, your meter will read 500 G. Do not mix these in your equations.
  • Forgetting μ0: A frequent mistake is multiplying μr directly by n and I, forgetting the 4π × 10-7 constant. μr is just a multiplier; it has no units and cannot generate a field on its own without the permeability of free space. For more on standard magnetic constants, consult the NIST guide on SI base units.
  • Wire Length vs. Coil Length: L is the length of the bobbin or the physical span of the winding, not the total unspooled length of the magnet wire. Using the total wire length in the denominator will result in a near-zero calculation.
Safety Note: When driving high currents through low-resistance air-core coils to achieve high B fields, the wire will rapidly exceed its thermal ampacity. Always calculate the DC resistance (R = ρ · l / A) and verify that your I²R heat dissipation is within the thermal limits of your magnet wire's insulation class (e.g., Class H rated for 180°C).