Physics & Mechanics

Ampere's Law (Solenoid) Calculator

Calculate the magnetic field inside an ideal solenoid using Ampere's Law. Solve for magnetic field strength (B) based on current, turns, and length.

A
m
Magnetic Field (B)
0.013

Calculated locally in your browser. Fast, secure, and private.

Magnetic Fields in Solenoids

Ampere's Law relates the integrated magnetic field around a closed loop to the electric current passing through that loop. While it is a complex calculus-based law, its most practical application is calculating the magnetic field inside a solenoid (a coil of wire).

A solenoid is the basis for electromagnets, inductors, and even the valves in your car's fuel injectors. Inside an ideal solenoid, the magnetic field is remarkably uniform and strong, while outside, it is nearly zero.

Factors Affecting Solenoid Strength

  • Turn Density ($n$): The number of turns per meter of length ($N/L$). More tightly packed coils produce stronger fields.
  • Current ($I$): Increasing the current linearly increases the magnetic field strength.
  • Core Material: While this formula assumes an air core, adding a "ferromagnetic" core (like iron) can increase the field strength by thousands of times.

The Formula

B=μ0NLI\begin{aligned} B = \mu_0 \cdot \frac{N}{L} \cdot I \end{aligned}

Where:
B=
Magnetic Field (Tesla, T)
μ0\mu_0=
Permeability (4π × 10⁻⁷ T·m/A)
N=
Total number of turns
L=
Length of solenoid (meters)
I=
Current (Amperes)

Example Calculation

You have a solenoid $0.2 , \text{m}$ ($20 , \text{cm}$) long with $500$ turns of wire. You pass $2 , \text{Amps}$ through it.

  1. Calculate n ($N/L$): $500 / 0.2 = 2,500 , \text{turns/meter}$.
  2. Multiply by Constant and Current: $(4\pi \times 10^{-7}) \times 2,500 \times 2 \approx 0.00628 , \text{T}$.

The field inside is roughly $6.3 , \text{mT}$.

Frequently Asked Questions

In an ideal, infinitely long solenoid, the magnetic field lines from each individual turn of wire cancel each other out perfectly on the outside but add up constructively on the inside.

You can increase the current, increase the number of turns, or most effectively, insert an iron core. The iron core concentrates the magnetic flux, making the solenoid a powerful electromagnet.

A toroid is simply a solenoid bent into a circle (like a donut). Toroids are even better at containing magnetic fields, as the field lines form a closed loop inside the donut and almost nothing leaks out.