On this page
The familiar μ₀I/(2πr) only holds outside a wire. Inside, the answer depends on where the current flows, and exam questions such as "which graph is correct?" test exactly this.
What does Ampère's law say about a current-carrying wire?
Ampère's law says that around any closed path, the line integral of B equals μ₀ times the total current passing through a surface bounded by that path (OpenStax University Physics, Volume 2, section 12.5). For a long straight wire, take a circle of radius r centred on the axis. By symmetry B is the same all round it and points along it, so the integral is B × 2πr.
So B = μ₀I(enc)/(2πr), and every case below is a different enclosed current, I(enc).
The 2022 CODATA value of μ₀ is 1.25663706127 × 10⁻⁶ N A⁻² (NIST), so μ₀/2π is almost exactly 2 × 10⁻⁷ T m/A, which keeps the arithmetic easy.
What is the magnetic field inside a solid wire?
Take a wire of radius a carrying current I spread evenly over its cross-section. A circle of radius r < a encloses only the fraction r²/a² of the current. Ampère's law then gives B = μ₀I r/(2πa²) inside the wire and B = μ₀I/(2πr) outside it (OpenStax, Example 12.7).
So B ∝ r inside: zero on the axis, rising in a straight line to its largest value, μ₀I/(2πa), at the surface, then falling as 1/r.
Why is the magnetic field zero inside a hollow wire?
Now make the wire a pipe, with current only in a wall between inner radius R₁ and outer radius R₂. Any circle with r < R₁ encloses no current, so B × 2πr = 0 and B = 0 everywhere in the hollow. It is the magnetic twin of the zero electric field inside a charged shell, which you meet in Gauss's law problems.
Inside the wall, the enclosed current is I(r² − R₁²)/(R₂² − R₁²), so B = μ₀I(r² − R₁²)/[2πr(R₂² − R₁²)]. Outside, the pipe behaves exactly like a thin wire: B = μ₀I/(2πr).
How do you draw the B–r graph for a solid and a hollow wire?
Worked example: a solid wire of radius 2 mm carries 10 A. Using the OpenStax formulas and μ₀/2π = 2 × 10⁻⁷ T m/A:
On the axis, r = 0: nothing enclosed, so B = 0.
At r = 1 mm: B = 2 × 10⁻⁷ × 10 × (1 × 10⁻³)/(2 × 10⁻³)² = 0.5 mT.
At the surface, r = 2 mm: B = 2 × 10⁻⁷ × 10/(2 × 10⁻³) = 1 mT, the peak.
At r = 4 mm: B = 2 × 10⁻⁷ × 10/(4 × 10⁻³) = 0.5 mT.
1 mm and 4 mm give the same field: every value between zero and the peak occurs at two radii.
Now use a pipe with R₁ = 1 mm and R₂ = 2 mm, same 10 A. At r = 1.5 mm the enclosed current is 10 × (2.25 − 1)/(4 − 1) ≈ 4.2 A, so B ≈ 2 × 10⁻⁷ × 4.2/(1.5 × 10⁻³) ≈ 0.56 mT. From 2 mm outwards it matches the solid wire exactly.
Sketching rules:
Solid wire: a straight line from the origin to the peak at r = a, then a 1/r curve that never touches zero.
Hollow pipe: flat at zero up to R₁, a curve bending slightly downwards as it rises to the same peak at R₂, then the same 1/r tail.
What is the magnetic field in a coaxial cable?
A coaxial cable has a solid inner wire of radius a inside a conducting shell from radius b to c. Current I goes out along the core and back along the shell:
r < a: B = μ₀I r/(2πa²), as for a solid wire.
a < r < b: the whole core current is enclosed, so B = μ₀I/(2πr).
b < r < c: part of the return current is enclosed, so B = μ₀I(c² − r²)/[2πr(c² − b²)], falling to zero at r = c.
r > c: the enclosed current is I − I = 0, so B = 0.
The cable produces no field outside as long as the two currents are equal and opposite (Georgia Tech Physics Book).
Where do students lose marks on these questions?
Using μ₀I/(2πr) inside the wire. Find the enclosed current first, every time.
Forgetting that uniform current means uniform current density, so the enclosed current grows with area (r²), not radius.
Drawing a field inside a hollow pipe, or no field outside a single pipe. Only the coaxial cable, with its return current, is field-free outside.
For how Ampère's law sits beside Biot-Savart, read our guide to the fields of wires, loops and solenoids. For practice, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer, so you can see where your enclosed current went wrong. If enclosed current itself feels shaky, the Fermi Concept Library gives each physics concept its own lesson.



