calculator magnetic field

Magnetic Field Calculator

Use this calculator to estimate magnetic flux density B for common current geometries.

Formula: B = μ₀I / (2πr)

Constant used: μ₀ = 4π × 10⁻⁷ T·m/A

What is a magnetic field calculator?

A magnetic field calculator estimates the magnetic flux density, usually written as B, produced by electric current. In SI units, B is measured in tesla (T). Because tesla can be large for everyday situations, you’ll often see results in millitesla (mT) or microtesla (µT).

This page gives you a practical calculator magnetic field tool for three high-value cases used in physics classes, electronics design, and lab setup:

  • Magnetic field around a long straight conductor
  • Magnetic field at the center of a circular loop
  • Magnetic field inside an ideal solenoid

Core equations used by the calculator

1) Long straight wire

For a wire carrying current I, measured at radial distance r from the wire:

B = μ₀I / (2πr)

The field decreases as distance increases, so doubling r halves B.

2) Circular loop (center point)

For a loop of radius R carrying current I with N turns:

B = μ₀NI / (2R)

More turns and more current increase field strength linearly.

3) Ideal solenoid (near center)

For a solenoid with N turns, length L, and current I:

B = μ₀(N/L)I

The turn density n = N/L is key. A tighter winding produces a stronger field for the same current.

How to use this calculator magnetic field tool

  1. Select geometry from the dropdown.
  2. Enter current I in amperes.
  3. Enter the geometry values (distance, radius, turns, or length).
  4. Click Calculate Magnetic Field.

The result area shows B in T, mT, and µT, plus the exact formula applied.

Worked examples

Example A: straight wire

Suppose I = 8 A and r = 0.02 m.

B = μ₀I/(2πr) = (4π×10⁻⁷ × 8)/(2π×0.02) = 8.0×10⁻⁵ T = 0.08 mT = 80 µT.

Example B: circular loop

If I = 2 A, R = 0.05 m, and N = 20 turns:

B = μ₀NI/(2R) = (4π×10⁻⁷ × 20 × 2)/(2×0.05) ≈ 5.03×10⁻⁴ T = 0.503 mT.

Example C: solenoid

Let I = 1.5 A, N = 1000 turns, L = 0.4 m.

B = μ₀(N/L)I = 4π×10⁻⁷ × (1000/0.4) × 1.5 ≈ 4.71×10⁻³ T = 4.71 mT.

Important assumptions and limitations

  • Straight wire model assumes a very long wire and ignores end effects.
  • Loop model gives field only at the center of the loop.
  • Solenoid model is best for long, tightly wound solenoids near the center.
  • Nearby magnetic materials (steel, ferrites) can significantly alter real-world results.
  • This calculator uses ideal vacuum permeability μ₀; practical setups may differ.

Where this is useful

Education and labs

Students use magnetic field equations constantly in electromagnetism courses. Fast calculation helps check homework and lab predictions.

Electronics and prototyping

Engineers can estimate coil field strength before building prototypes for relays, sensors, or actuators.

Maker and hobby projects

From DIY electromagnets to induction experiments, quick B-field estimates improve safety and performance.

Common mistakes to avoid

  • Using centimeters instead of meters without conversion.
  • Confusing magnetic field strength H (A/m) with magnetic flux density B (T).
  • Entering zero or negative geometry values.
  • Forgetting that these formulas are idealized approximations.

Final note

If you need advanced models (finite-length coils, off-axis loop field, magnetic cores with relative permeability, or Helmholtz coil geometry), this page is a strong starting point—but a simulation tool or numerical solver is the next step. For most classroom and early design work, this calculator magnetic field setup is fast, accurate enough, and easy to trust.

🔗 Related Calculators