COLLEGE PHYSICS • MAGNETIC FIELDS & ELECTROMAGNETISM

Magnetic Fields of Current-Carrying Wires

How moving charges generate magnetic fields that permeate the space around conductors.

Historical Context & Motivation

For centuries, electricity and magnetism were regarded as entirely separate phenomena — static electricity produced sparks and lightning, while magnetism was the province of lodestones and compass needles. The intellectual breakthrough that unified these two domains began almost by accident in a Copenhagen lecture hall in 1820, when Hans Christian Ørsted noticed a compass needle deflect as current flowed through a nearby wire. That single observation launched one of the most productive eras in the history of physics, linking the flow of charge to the generation of magnetic fields and ultimately leading to Maxwell's unified theory of electromagnetism.

1820
Ørsted's Discovery
Hans Christian Ørsted demonstrates that an electric current deflects a compass needle, establishing the first direct link between electricity and magnetism. Within weeks, the news spreads across Europe and sparks intense research.
1820
Biot–Savart Law
Jean-Baptiste Biot and Félix Savart quantify the magnetic field produced by a short segment of current-carrying wire, deriving the inverse-square dependence on distance that bears their names.
1826
Ampère's Circuital Law
André-Marie Ampère formulates a law relating the line integral of the magnetic field around a closed loop to the total current enclosed, providing a powerful tool for computing fields in symmetric geometries.
1865
Maxwell's Equations
James Clerk Maxwell synthesizes the work of Ørsted, Ampère, and Faraday into four elegant equations, predicting electromagnetic waves and forever unifying electric and magnetic phenomena.

The central question that emerged from Ørsted's observation is deceptively simple: given a wire carrying a steady current I, what is the precise magnitude and direction of the magnetic field B at every point in the surrounding space? Answering this question rigorously requires the Biot–Savart law for arbitrary geometries and Ampère's law for highly symmetric ones — the two mathematical pillars upon which this lesson is built.

Core Principles & Definitions

Before diving into calculations, it is essential to internalize several foundational principles that govern the magnetic fields generated by steady currents. These principles connect the microscopic motion of charge carriers to the macroscopic field geometry and establish the conceptual vocabulary needed throughout the lesson.

1

Moving Charges Create B Fields

A stationary charge produces only an electric field. Once the charge moves — constituting a current — it also generates a magnetic field that encircles the direction of motion. No current, no magnetic field.
2

Right-Hand Rule

Point the thumb of your right hand in the direction of conventional current (positive flow). Your fingers naturally curl in the direction of the magnetic field lines, which form closed loops around the wire.
3

Superposition Principle

The net magnetic field at any point is the vector sum of the contributions from every current element in the system. This allows complex geometries to be decomposed into simpler pieces.
4

Inverse-Distance Dependence

For an infinitely long straight wire, the field magnitude falls off as 1/r, where r is the perpendicular distance from the wire. This is distinct from the 1/r² decay of a point charge's electric field.
KEY TAKEAWAY
Think of a current-carrying wire like a rotating garden sprinkler: the water (magnetic field) doesn't shoot outward in a straight line but instead sweeps around the sprinkler head (the wire) in circular patterns. The further you stand from the sprinkler, the weaker the spray — and the direction of the spray is always tangent to the circle, never pointing toward or away from the source.

Visualizing the Magnetic Field

The magnetic field around a long, straight current-carrying wire forms concentric circles centered on the wire. The following diagram illustrates a cross-sectional view: the wire carries conventional current out of the page (represented by a dot), and the field lines circulate counterclockwise according to the right-hand rule. Notice that the spacing between field lines increases with distance, reflecting the 1/r decrease in field strength.

Cross-sectional view of the magnetic field lines (cyan circles) around a long, straight wire carrying current out of the page. The arrows show the counterclockwise circulation dictated by the right-hand rule, and the increasing spacing between circles reflects the 1/r decrease in field magnitude.

Several key features are visible in the diagram. First, every field line forms a closed loop — magnetic field lines never begin or end at a point, which is a direct consequence of Gauss's law for magnetism (∇ · B = 0). Second, the field is purely tangential: at any given point, B is perpendicular to the radial direction from the wire. Third, the diagram's symmetry — identical in every azimuthal direction — is precisely what makes Ampère's law so efficient for this geometry, as it allows us to pull B out of the line integral around any concentric circular Amperian loop.

Mathematical Framework

Two complementary laws allow us to calculate the magnetic field produced by current-carrying conductors. The Biot–Savart law is the general tool: it works for wires of any shape, though the integration can be challenging. Ampère's law is a special-purpose shortcut: when the current distribution has sufficient symmetry (infinite straight wire, solenoid, toroid), it yields the answer with far less effort.

The Biot–Savart Law

BIOT–SAVART LAW
dB = (μ₀ / 4π) × (I d𝓁 × r̂) / r²
where μ₀ = 4π × 10⁻⁷ T·m/A is the permeability of free space, I is the current, d𝓁 is an infinitesimal directed length element along the wire, is the unit vector from the source element to the field point, and r is the distance between them.

The cross product (d𝓁 × r̂) ensures that the contribution dB is always perpendicular to the plane defined by the current element and the line connecting it to the field point. For a straight wire of infinite length carrying current I, integrating the Biot–Savart law over the entire wire yields the well-known result for the field at perpendicular distance r.

Ampère's Law

AMPÈRE'S LAW (INTEGRAL FORM)
∮ B · d𝓁 = μ₀ I_enc
The line integral of the magnetic field around any closed path (Amperian loop) equals μ₀ times the total current I_enc threading through the loop. When symmetry makes B constant on the loop, the integral simplifies to B × (2πr).

Derivation: Infinite Straight Wire via Ampère's Law

Choose a circular Amperian loop of radius r centered on the wire. By the cylindrical symmetry of the problem, B has the same magnitude everywhere on this loop and is everywhere tangent to it. Therefore B · d𝓁 = B d𝓁 at every point, and the line integral becomes B × (2πr). Setting this equal to μ₀I and solving for B yields the fundamental result.

MAGNETIC FIELD — INFINITE STRAIGHT WIRE
B = μ₀I / (2πr)
This equation gives the magnitude of the magnetic field at perpendicular distance r from an infinitely long straight wire carrying current I. The direction is given by the right-hand rule: circumferential, forming closed loops.
FORCE BETWEEN TWO PARALLEL WIRES
F/L = μ₀ I₁ I₂ / (2πd)
Two parallel wires separated by distance d, carrying currents I₁ and I₂, exert a force per unit length F/L on each other. Parallel currents attract; antiparallel currents repel. This relationship historically defined the SI unit of current, the ampere.

Common Wire Configurations

While the infinite straight wire is the canonical example, many practical and exam-relevant situations involve different conductor geometries. Each configuration produces a characteristic field pattern that can be derived from the Biot–Savart law or, when symmetry permits, from Ampère's law. The following diagram and table summarize the three most important configurations encountered in introductory physics.

Comparison of three fundamental current-carrying wire configurations: the infinite straight wire, the circular loop (field on the axis), and the solenoid (uniform interior field). Each box includes the relevant formula and qualitative behavior.
Summary of magnetic field formulas for standard current-carrying wire configurations
ConfigurationFormula for BField PatternBest Method
Infinite Straight Wireμ₀I / (2πr)Concentric circles; magnitude falls as 1/rAmpère's law
Circular Loop (center)μ₀I / (2R)Dipole-like; field along axis through centerBiot–Savart law
Circular Loop (on axis)μ₀IR² / [2(R² + x²)³ᐟ²]Axial field; falls off as 1/x³ for x ≫ RBiot–Savart law
Solenoid (interior)μ₀nIUniform and parallel to axis inside; ≈ 0 outsideAmpère's law
Toroidμ₀NI / (2πr)Confined to interior of torus; zero outsideAmpère's law

Worked Example: Field from Two Parallel Wires

Two long, parallel wires are separated by a distance d = 20 cm. Wire 1 carries a current I₁ = 5.0 A to the right, and Wire 2 carries a current I₂ = 3.0 A also to the right. Determine the magnitude and direction of the net magnetic field at a point P located midway between the wires.

Net Magnetic Field at the Midpoint Between Two Parallel Wires
1
Step 1 — Identify Given Values and GeometryWire 1: I₁ = 5.0 A (to the right). Wire 2: I₂ = 3.0 A (to the right). Separation d = 0.20 m. Point P is at the midpoint, so the perpendicular distance from each wire to P is r = d/2 = 0.10 m. Since both currents flow in the same direction (parallel currents), we must carefully determine the direction of each wire's contribution at P using the right-hand rule.
r = 0.10 m for both contributions
2
Step 2 — Calculate B₁ from Wire 1Using B = μ₀I / (2πr): B₁ = (4π × 10⁻⁷ T·m/A)(5.0 A) / (2π × 0.10 m) = (2.0 × 10⁻⁶) / (0.6283) = 1.0 × 10⁻⁵ T = 10 μT. By the right-hand rule, if Wire 1's current points to the right and P is below it (assuming Wire 1 is on top), B₁ at P points out of the page.
B₁ = 10 μT, directed out of the page
3
Step 3 — Calculate B₂ from Wire 2Similarly: B₂ = (4π × 10⁻⁷)(3.0) / (2π × 0.10) = (6.0 × 10⁻⁷) / (0.6283) = 6.0 × 10⁻⁶ T = 6.0 μT. Wire 2 is below P with current to the right, so by the right-hand rule, B₂ at P points into the page.
B₂ = 6.0 μT, directed into the page
4
Step 4 — Apply SuperpositionThe two fields are antiparallel at P (one out of the page, one into the page). The net field magnitude is the difference: B_net = B₁ − B₂ = 10 μT − 6.0 μT = 4.0 μT. Since B₁ > B₂, the net field points in the direction of B₁, which is out of the page.
B_net = 4.0 μT, directed out of the page
5
Step 5 — Physical CheckThe result makes sense: at the midpoint between two parallel wires carrying currents in the same direction, the fields partially cancel because they point in opposite directions. If the currents were equal, the field at the midpoint would be exactly zero. Here, Wire 1 carries the larger current, so its contribution dominates, and the net field has a finite value directed out of the page.

Biot–Savart Law vs. Ampère's Law

Students often wonder when to use the Biot–Savart law versus Ampère's law. The answer depends entirely on the symmetry of the problem. Ampère's law is computationally elegant but only yields a simple result when you can identify an Amperian loop along which B is constant and either parallel or perpendicular to d𝓁 everywhere. In the absence of such symmetry, you must resort to the Biot–Savart law, which works universally but often requires nontrivial integration.

Comparison of the two primary methods for computing magnetic fields from currents
FeatureBiot–Savart LawAmpère's Law
GeneralityWorks for any current distribution — finite wires, loops, arbitrary shapesRequires high symmetry: infinite wires, solenoids, toroids
Mathematical formVector integral over current elements; involves cross productsScalar line integral around a closed loop
Typical difficultyOften requires careful parameterization and trigonometric integralsReduces to algebra once the correct loop is chosen
Direction infoAutomatically gives direction via the cross productGives magnitude; direction found separately via the right-hand rule
AnalogyLike Coulomb's law for electric fields — fundamental but brute-forceLike Gauss's law for electric fields — elegant but needs symmetry
STRATEGY GUIDE
Think of Ampère's law as a GPS shortcut through a familiar city — it gets you to the answer instantly, but only on well-mapped routes (high-symmetry geometries). The Biot–Savart law is the paper map: it always works but requires you to trace every turn yourself. On an exam, your first instinct should be to check for symmetry. If you can draw an Amperian loop where B is constant and tangent, use Ampère's law. Otherwise, set up the Biot–Savart integral.

Connection to Advanced Electromagnetism

Everything developed in this lesson applies to magnetostatics — the regime in which currents are steady and charge distributions do not change in time. When currents vary, the story becomes richer and more complex. Maxwell recognized that Ampère's original law was incomplete: a time-varying electric field also generates a magnetic field, captured by the displacement current term he added. This correction completed the set of equations now known as Maxwell's equations and predicted the existence of electromagnetic waves — light itself.

Magnetostatics vs. full electrodynamics
FeatureThis Lesson (Magnetostatics)Advanced (Full Electrodynamics)
CurrentsSteady (∂ρ/∂t = 0); fields do not change in timeTime-varying; fields are dynamic and coupled
Ampère's law∮ B · d𝓁 = μ₀I_enc∮ B · d𝓁 = μ₀I_enc + μ₀ε₀ dΦ_E/dt (includes displacement current)
Key resultStatic B fields from wires, loops, and solenoidsElectromagnetic waves, radiation, and antenna theory
Mathematical toolsVector calculus: line integrals, cross productsPDEs, wave equations, retarded potentials, tensor notation

In your next courses — particularly in intermediate electromagnetism (often structured around Griffiths' textbook) — you will see how Faraday's law of induction and the displacement current generalize the concepts introduced here. The magnetic vector potential A (where B = ∇ × A) will become a central object, simplifying calculations and connecting deeply to quantum mechanics through the Aharonov–Bohm effect. For now, however, a thorough command of the Biot–Savart law and Ampère's law for steady currents provides the essential foundation upon which all of these advanced developments rest.

Practice Problems

PROBLEM 1CONCEPTUAL
A long, straight wire carries a steady current I directed to the east. Using the right-hand rule, determine the direction of the magnetic field at a point directly above the wire and at a point directly below the wire. Explain why the field lines form closed loops and what this implies about the existence of magnetic monopoles.
PROBLEM 2BASIC CALCULATION
A long, straight wire carries a current of 8.0 A. Calculate the magnitude of the magnetic field at a perpendicular distance of 5.0 cm from the wire. Express your answer in microtesla (μT).
PROBLEM 3INTERMEDIATE
A circular loop of wire has a radius R = 12 cm and carries a current of 4.0 A. Calculate the magnetic field at (a) the center of the loop and (b) a point on the axis 20 cm from the center. Compare the two results and comment on how rapidly the axial field decays.
PROBLEM 4APPLIED
An MRI machine uses a solenoid 2.0 m long with 10,000 turns to produce a uniform internal field of 1.5 T. What current must flow through the windings? If the wire has a resistance of 0.50 Ω per meter and the total wire length is 6.3 km, calculate the power dissipated. Comment on why real MRI magnets are superconducting.
PROBLEM 5CRITICAL THINKING
Two infinitely long, parallel wires separated by distance d carry equal currents I but in opposite directions (antiparallel). Derive an expression for the magnetic field magnitude at an arbitrary point P that lies in the plane of the wires, at distance x from the midpoint (along the line connecting the wires), where |x| < d/2. Show that the field diverges as P approaches either wire and identify the symmetry of the field profile. What happens at the midpoint?

Lesson Summary

This lesson established that moving charges (currents) produce magnetic fields, a discovery rooted in Ørsted's 1820 experiment. The direction of the field is determined by the right-hand rule, and the field lines form closed loops around the conductor. For an infinite straight wire, the magnitude obeys B = μ₀I / (2πr), derivable from either the Biot–Savart law or Ampère's law. The superposition principle allows the net field from multiple wires to be computed as the vector sum of individual contributions.

Key configurations include the straight wire (B ∝ 1/r), the circular loop (dipole field, B = μ₀I/2R at center), and the solenoid (uniform interior field B = μ₀nI). Two parallel wires interact via the force per unit length F/L = μ₀I₁I₂/(2πd), with parallel currents attracting and antiparallel currents repelling. These results form the magnetostatic foundation upon which Maxwell's full electromagnetic theory — including time-varying fields, electromagnetic waves, and modern technologies like MRI — is built.

Varsity Tutors • College Physics • Magnetic Fields of Current-Carrying Wires