The fundamental magnetism formula for calculating the magnetic flux density inside an ideal solenoid is B = μ · n · I. This equation tells you exactly how strong the magnetic field (B) will be in Tesla, based on the core material's permeability (μ), the coil's turn density (n), and the drive current (I). Whether you are winding a custom relay, designing a linear actuator, or building an electromagnet for a scrapyard claw, this single relationship dictates your physical design constraints.

Below, we break down every variable, rearrange the formula for practical bench work, and walk through two fully tracked examples to show how the math translates to real-world copper and iron.

The Core Magnetism Formula and Symbol Definitions

The macroscopic magnetism formula for a long, tightly wound solenoid is expressed as:

B = μ · n · I
Where μ = μ₀ · μᵣ

This formula calculates the uniform magnetic field deep inside the coil. To use it correctly, you must understand the strict physical assumptions it relies on: the solenoid must be 'ideal' (its length is significantly greater than its diameter), the turns must be tightly and evenly spaced, and the calculation only holds true for the field inside the coil, far from the fringing effects at the ends.

Magnetism Formula Symbol Definitions
SymbolQuantityStandard SI UnitDefinition & Bench Notes
BMagnetic Flux DensityTesla (T)The strength of the magnetic field. Often measured in Gauss (1 T = 10,000 G) on the bench.
μAbsolute PermeabilityT·m/A or H/mThe core material's ability to support a magnetic field. Calculated as μ₀ × μᵣ.
μ₀Permeability of Free SpaceT·m/AApproximately 4π × 10⁻⁷ T·m/A. (Note: Since the 2019 SI redefinition, this is an experimentally determined value, not an exact constant, though the difference is negligible for DIY design).
μᵣRelative PermeabilityDimensionlessThe multiplier for your core material. Air = 1, Ferrite ≈ 200-2000, Silicon Steel ≈ 4000-7000.
nTurn Densityturns/meter (m⁻¹)Total turns (N) divided by the coil length (L) in meters. Not to be confused with total turns.
ICurrentAmperes (A)The DC current flowing through the wire. Limited by your wire gauge's ampacity and thermal dissipation.

Rearranged Forms for Coil Design

On the workbench, you rarely solve for B in a vacuum. Usually, you have a target magnetic field and need to figure out how many turns to wind or how much current your power supply must deliver. Here are the practical rearrangements of the magnetism formula:

  • Solving for Required Current (I): I = B / (μ · n)
    Use when: You have a fixed coil geometry and core, and need to size your DC power supply or current-limiting resistor.
  • Solving for Turn Density (n): n = B / (μ · I)
    Use when: You know your available current and core material, and need to calculate how tightly to wind the coil. Multiply by your coil length (L) to get total turns (N).
  • Solving for Total Turns (N): N = (B · L) / (μ · I)
    Use when: You are cutting wire to length and need to know the exact number of wraps to hit your target field.
  • Solving for Required Permeability (μ): μ = B / (n · I)
    Use when: You are selecting a core material (e.g., choosing between powdered iron, ferrite, or electrical steel) based on a fixed coil and current budget.

Worked Examples with Unit Tracking

Abstract formulas fail when unit conversions are botched. Here are two step-by-step derivations tracking every unit from raw measurements to the final Tesla reading.

Example 1: Air-Core Coil for a Galvanometer

Scenario: You are winding an air-core coil for a sensitive DIY galvanometer. You use 500 turns of 28 AWG magnet wire, wound tightly over a 20 cm (0.2 m) length. You drive it with a precise 150 mA (0.15 A) DC current. What is the magnetic flux density inside the coil?

Step 1: Identify and convert variables to base SI units.

  • N = 500 turns
  • L = 20 cm = 0.2 m
  • I = 150 mA = 0.15 A
  • μᵣ = 1 (air core)
  • μ₀ ≈ 1.2566 × 10⁻⁶ T·m/A (4π × 10⁻⁷)

Step 2: Calculate turn density (n).

  • n = N / L = 500 turns / 0.2 m = 2500 turns/m

Step 3: Calculate absolute permeability (μ).

  • μ = μ₀ · μᵣ = (1.2566 × 10⁻⁶ T·m/A) · 1 = 1.2566 × 10⁻⁶ T·m/A

Step 4: Apply the magnetism formula.

  • B = μ · n · I
  • B = (1.2566 × 10⁻⁶ T·m/A) · (2500 m⁻¹) · (0.15 A)
  • B = 4.712 × 10⁻⁴ T

Result: The magnetic field is 0.471 mT (or 4.71 Gauss). This is a weak field, roughly 10 times stronger than the Earth's natural magnetic field, which is appropriate for a sensitive galvanometer needle deflection.

Example 2: Iron-Core Electromagnet for a Scrap Lifter

Scenario: You need a lifting electromagnet that generates a minimum of 0.8 T to reliably pick up steel plate. You have a silicon steel core (relative permeability μᵣ = 4000) and a coil form that is 10 cm (0.1 m) long. You wind 200 turns of 14 AWG wire. How much current is required?

Step 1: Identify variables.

  • Target B = 0.8 T
  • N = 200 turns
  • L = 0.1 m
  • μᵣ = 4000

Step 2: Calculate turn density (n) and absolute permeability (μ).

  • n = 200 / 0.1 = 2000 turns/m
  • μ = (4π × 10⁻⁷) · 4000 ≈ 5.0265 × 10⁻³ T·m/A

Step 3: Rearrange formula to solve for I.

  • I = B / (μ · n)
  • I = 0.8 T / (5.0265 × 10⁻³ T·m/A · 2000 m⁻¹)
  • I = 0.8 / 10.053
  • I ≈ 0.0795 A

Result: The math dictates you only need 79.5 mA of current. However, here is where bench experience overrides raw math: silicon steel begins to saturate around 1.5 T to 2.0 T, but its permeability (μᵣ) is not a flat 4000 across the entire B-H curve. As you approach 0.8 T, μᵣ will start dropping off the linear region. Furthermore, 14 AWG wire is rated for 15A to 25A depending on insulation; running only 80mA through it is a massive overbuild in copper, but ensures zero thermal issues. For a reliable design, you would prototype this at 100 mA and measure the actual field with a Gaussmeter to account for the non-linear B-H curve of the steel.

Realistic Magnitudes and Unit Traps

When you calculate B, you need a sanity check to know if your answer makes physical sense. If your math spits out 50 Tesla, you have made a mistake; continuous fields above 45 T require massive, water-cooled resistive magnets or superconducting arrays at national labs.

Realistic Magnetic Field Magnitudes

  • Earth's Magnetic Field: ~25 to 65 μT (0.00005 T)
  • Refrigerator Magnet: ~5 mT (0.005 T)
  • DIY Air-Core Coil (1A, 1000 turns/m): ~1.2 mT (0.0012 T)
  • Industrial Electromagnet / MRI: 1.0 T to 3.0 T
  • Neutron Star Surface: ~10⁸ T (Theoretical limit context)

Unit Mistakes That Break the Formula

The most common reason DIY electromagnets fail to match their theoretical pull force is a unit conversion error in the magnetism formula. Watch out for these specific traps:

  1. Forgetting to convert cm to meters for Length (L): If your coil is 5 cm long and you plug '5' into the denominator for n = N/L, your turn density will be off by a factor of 100. Always convert physical dimensions to meters before calculating n.
  2. Using μᵣ instead of μ: A classic mistake is plugging the relative permeability of iron (e.g., 5000) directly into the μ slot without multiplying by μ₀ (4π × 10⁻⁷). This will result in a calculated magnetic field that is billions of times too high.
  3. Confusing Total Turns (N) with Turn Density (n): The formula requires turns per meter. If you just multiply μ · I · N, you are ignoring the physical length of the coil, which entirely changes the geometry of the magnetic circuit.
Ampacity Warning: The magnetism formula does not care if your wire melts. If your rearranged formula demands 40 Amps to achieve your target B, but you wound the coil with 22 AWG magnet wire (which typically handles ~1A to 2A before overheating in a tight, unventilated coil), the insulation will melt, shorting the turns and dropping your effective N to zero. Always cross-reference your calculated 'I' with the ampacity limits of your chosen AWG wire gauge.

Frequently Asked Questions

How does the magnetism formula change for an AC current?

The core formula B = μ · n · I remains structurally identical for AC, but 'I' becomes a time-varying function, typically I(t) = I_peak · sin(ωt). Consequently, your magnetic field B(t) will also oscillate sinusoidally. However, in practical AC electromagnets (like transformers or AC contactors), you must account for core losses. The alternating field induces eddy currents in the core material, generating heat. This is why AC electromagnets and transformers use laminated silicon steel cores or ferrites rather than solid blocks of iron—the laminations break up the conductive paths, minimizing eddy current losses that the basic DC formula does not predict.

Why does my calculated magnetic field not match my Gaussmeter reading?

If your theoretical calculation yields 0.5 T but your bench Gaussmeter reads 0.3 T, you are likely experiencing core saturation or fringing losses. The formula B = μ · n · I assumes a constant μᵣ. In reality, ferromagnetic materials have a non-linear B-H curve. As the magnetic domains in the iron align, the material 'saturates,' and its effective relative permeability (μᵣ) plummets toward 1. Additionally, the formula calculates the field deep inside an infinitely long solenoid. At the physical ends of your real-world coil, the magnetic field lines bow outward (fringing), and the flux density drops to roughly half of the center value. Always measure at the exact geometric center of the coil for the closest match to the math.

Can I use the magnetism formula for a single loop of wire?

No. The solenoid formula B = μ · n · I is derived specifically for a long, multi-turn cylinder where the fields of adjacent loops superimpose to create a uniform, straight internal field. For a single circular loop of wire, the magnetic field at the exact center is calculated using a different derivation from the Biot-Savart Law: B = (μ₀ · I) / (2 · r), where 'r' is the radius of the loop in meters. If you try to use the solenoid formula for a single loop by setting N=1 and L=wire diameter, the geometric assumptions collapse, and your calculated Tesla value will be wildly inaccurate.