Magnetic Field Calculator
Calculate magnetic field from a wire B = μ₀I/(2πr) or solenoid B = μ₀nI.
What Is Magnetic Field?
The magnetic field B (measured in Tesla, T) is created by electric currents. For an infinitely long straight wire carrying current I, the field at perpendicular distance r is: B = μ₀I/(2πr), where μ₀ = 4π×10⁻⁷ T·m/A is the permeability of free space. The field circles the wire (right-hand rule: thumb along current, fingers curl in B direction).
For a solenoid (tightly wound coil of N turns over length L, with n = N/L turns per meter): B = μ₀nI inside (uniform and parallel to axis), and B ≈ 0 outside. Solenoids create strong uniform magnetic fields — used in MRI machines (superconducting solenoids at ≈7 T), particle accelerators, and electromagnetic brakes.
Magnetic field strength: Earth's field ≈ 5×10⁻⁵ T (50 μT). A common refrigerator magnet: 5×10⁻³ T. Clinical MRI: 1.5–7 T. Research magnets: 20–45 T (resistive) or up to 100 T in pulsed fields. Magnetic resonance requires strong uniform fields — hence solenoids.
The Biot-Savart Law gives the fundamental magnetic field from a current element: dB = μ₀I(dL×r̂)/(4πr²). For complex geometries, this integral is evaluated numerically. Ampere's Law ∮B·dL = μ₀I_enclosed is used analytically for symmetric configurations (wires, solenoids, toroids).
Formula Reference Table
| Solve For | Formula | Notes |
|---|---|---|
| Long straight wire | B = μ₀I/(2πr) | μ₀ = 4π×10⁻⁷ T·m/A |
| Solenoid (inside) | B = μ₀nI | n = turns/meter |
| Toroid | B = μ₀NI/(2πr) | N = total turns, r = mean radius |
| Force on parallel wires | F/L = μ₀I₁I₂/(2πd) | Attractive if currents parallel |
| Current in wire from B | I = B·2πr/μ₀ | Inverse of wire formula |
| Definition of 1 Ampere | F/L = 2×10⁻⁷ N/m | For wires 1 m apart with 1 A each |
3 Worked Examples
10 A wire. Find B at r = 5 cm.
- B = μ₀I/(2πr) = (4π×10⁻⁷ × 10)/(2π × 0.05)
- B = 4π×10⁻⁶ / (0.1π) = 4×10⁻⁵ T = 40 μT
- Similar to Earth's magnetic field strength
MRI solenoid: n = 1,000 turns/m, I = 500 A (superconducting).
- B = μ₀nI = 4π×10⁻⁷ × 1000 × 500 = 0.628 T
- At n = 11,000 turns/m, I = 1,000 A: B = 13.8 T
- Superconducting coils carry kA currents with zero resistance
Two parallel wires 10 cm apart, each carrying 100 A. Force per meter?
- F/L = μ₀I₁I₂/(2πd) = 4π×10⁻⁷ × 100 × 100/(2π × 0.1)
- F/L = 4π×10⁻⁷ × 10,000 / (0.2π) = 0.02 N/m
- Attractive (currents in same direction) — 20 mN per meter of wire
Real-World Applications
Common Mistakes to Avoid
μ₀ must be in SI units: 4π×10⁻⁷ T·m/A = 1.257×10⁻⁶ T·m/A. Using 4π (without the 10⁻⁷) gives B 10⁷× too large.
B = μ₀I/(2πr): r is the perpendicular distance from the wire to the field point, not the wire's diameter.
Solenoid: B = μ₀nI (inside, uniform). Wire: B = μ₀I/(2πr) (outside, varies with distance). They are different geometries.
Curl right-hand fingers around wire with thumb pointing in current direction — fingers show B field curl direction. For force on a wire: F = IL×B (cross product).
Iron-core electromagnets: B = μ₀μᵣnI. Iron has μᵣ ≈ 1,000–100,000, dramatically amplifying B. For air-core, μᵣ = 1.
Frequently Asked Questions
Related Physics Calculators
Formula Explorer connections
Interpretation: This relationship connects magnetic fields, moving charge, flux, induction or electromagnetic material response. Assumption: Specify field direction and sign convention. Uniform fields, linear materials, negligible edge effects or sinusoidal steady state may be assumed.