All Tools

Magnetic Field Explorer

Select a current source (straight wire, circular loop, solenoid, or two parallel wires), adjust the parameters, and see the 2D field pattern with B-field magnitude and step-by-step derivation. All calculations run in your browser.

Parameters

Current I5.0 A
Probe Distance r0.020 m

2D Field Pattern

Cross-section (wire into/out of page)
Current into pageCurrent out of pageB-field linesProbe point PPrI (into page)

Results for Infinite Straight Wire

B-field Magnitude
5.00e-5 T
Direction
Concentric circles around wire (tangential)

Right-Hand Rule

Point thumb in current direction. Fingers curl in the direction of B.

Step-by-Step Derivation

Step 1: Apply Ampere's Law (or Biot-Savart)
Step 2: Ampere's Law
Step 3: By Symmetry, B is Constant on Loop
Step 4: Solve for B
Step 5: Direction (Right-Hand Rule)

Reference Guide

Biot-Savart Law

The Biot-Savart Law gives the magnetic field produced by a small current element. It is the magnetic analog of Coulomb's Law.

dB=μ04πIdl×r^r2d\vec{B} = \frac{\mu_0}{4\pi} \frac{I \, d\vec{l} \times \hat{r}}{r^2}

where μ0=4π×107 T\cdotm/A\mu_0 = 4\pi \times 10^{-7} \text{ T\cdot m/A} is the permeability of free space. The cross product means dBd\vec{B} is always perpendicular to both the current element and the displacement vector.

Infinite Straight Wire

Integrating the Biot-Savart Law (or using Ampere's Law with a circular Amperian loop) gives the magnetic field at perpendicular distance r from an infinite wire carrying current I.

B=μ0I2πrB = \frac{\mu_0 I}{2\pi r}

The field lines form concentric circles around the wire. The direction is determined by the right-hand rule: point your thumb in the direction of current, and your fingers curl in the direction of the field.

Circular Current Loop

On the axis of a circular loop of radius R carrying current I, the magnetic field at distance x from the center is:

B=μ0IR22(R2+x2)3/2B = \frac{\mu_0 I R^2}{2(R^2 + x^2)^{3/2}}

At the center (x=0x = 0), this simplifies to B=μ0I2RB = \frac{\mu_0 I}{2R}. The field pattern resembles a magnetic dipole (bar magnet) far from the loop.

Solenoid Field

A solenoid with N turns over length L produces a nearly uniform magnetic field inside. Using Ampere's Law with a rectangular loop:

Binside=μ0nI=μ0NLIB_{\text{inside}} = \mu_0 n I = \mu_0 \frac{N}{L} I

The field at the ends is half the interior value: Bend=μ0nI2B_{\text{end}} = \frac{\mu_0 n I}{2}. Outside an ideal, infinitely long solenoid, the field is approximately zero.