Magnetic Field of a Current-Carrying Wire: B = μ0I/2πr

Magnetic Field of a Current-Carrying Wire: Run current through a plain copper wire and something invisible happens around it: space itself becomes magnetic.
A compass placed nearby swings to point along the wire instead of north. Iron filings sprinkled around it snap into perfect circles. No magnet touched the wire — the current alone did it.
This is one of the most important discoveries in physics, and it’s also one of the most practical. It’s the working principle behind electric motors, MRI machines, current sensors, and every electromagnet ever built.
Table of Contents
What Is the Magnetic Field of a Current-Carrying Wire?
A current-carrying wire generates a magnetic field that forms concentric circles around it, perpendicular to the wire’s length. The field’s strength (B) is directly proportional to the current (I) and inversely proportional to the distance (r) from the wire, described by the formula B = μ₀I / 2πr. Its direction is found using the right-hand rule: point your right thumb in the direction of current flow, and your curled fingers show the direction of the magnetic field.
That single fact — moving charge creates magnetism — connects electricity and magnetism into one unified phenomenon: electromagnetism.
How a Current-Carrying Wire Creates a Magnetic Field

Oersted’s Discovery: The Origin of Electromagnetism
In 1820, Danish physicist Hans Christian Oersted was demonstrating basic electrical concepts in a lecture when he noticed something odd: a compass needle sitting near a wire moved whenever current flowed through it. Turn the current off, and the needle settled back to normal.
That accidental observation was the first direct evidence that electricity and magnetism were connected, not separate forces. Oersted’s discovery kicked off a wave of research across Europe — most notably by André-Marie Ampère and the duo Jean-Baptiste Biot and Félix Savart, whose names are now permanently attached to the two core laws used to calculate magnetic fields from current.
Why Moving Charges Produce a Magnetic Field
Electric current is simply charge in motion. A single moving charge creates a small magnetic field around its path. Multiply that by the trillions of electrons drifting through a wire, and their combined effect produces a magnetic field strong enough to move a compass needle or lift scrap metal in a junkyard electromagnet.
Key takeaway: Magnetism isn’t a separate phenomenon from electricity — it’s what electric charge does when it moves. A stationary charge creates only an electric field; a moving charge creates a magnetic field as well.
The Formula for Magnetic Field Around a Straight Wire
Breaking Down B = μ₀I / 2πr
For an infinitely long, straight wire, the magnetic field strength at any point is:
B = μ₀I / 2πr
| Symbol | Meaning | Unit |
|---|---|---|
| B | Magnetic field strength (flux density) | Tesla (T) |
| μ₀ | Permeability of free space | T·m/A |
| I | Current flowing through the wire | Amperes (A) |
| r | Perpendicular distance from the wire | Meters (m) |
Two relationships matter most:
- B is directly proportional to I — double the current, and the field doubles.
- B is inversely proportional to r — move twice as far away, and the field is cut in half. It is not an inverse-square relationship, which is a common point of confusion for students used to gravity and electric field formulas.
The Permeability of Free Space (μ₀)
μ₀ is a physical constant representing how easily a magnetic field can form in a vacuum (or, practically, in air). Its defined value is:
μ₀ = 4π × 10⁻⁷ T·m/A
This constant appears in nearly every magnetic field formula involving current, so it’s worth memorizing rather than looking up each time.
Worked Example: Calculating Magnetic Field Strength
Problem: Find the magnetic field strength at a distance of 2.0 m from a long, straight wire carrying 8.0 A of current.
Solution:
- Formula: B = μ₀I / 2πr
- Plug in values: B = (4π × 10⁻⁷ × 8.0) / (2π × 2.0)
- Simplify: B = (4 × 10⁻⁷ × 8.0) / (2 × 2.0) = (32 × 10⁻⁷) / 4
- Result: B = 8.0 × 10⁻⁷ T, or 0.8 microtesla.
For comparison, Earth’s magnetic field at the surface is roughly 25–65 microtesla — so a single household wire’s field is typically far weaker than the planet’s own background field unless you’re extremely close to it or the current is very large.
Finding the Direction: The Right-Hand Rule
Step-by-Step: How to Apply the Right-Hand Rule
- Point your right thumb in the direction conventional current flows through the wire (from positive to negative terminal).
- Curl your fingers naturally around the wire, as if gripping it.
- Read the direction: the way your fingers curl is the direction the magnetic field circles around the wire.
This is often called the “field-finding” right-hand rule, and it works for any straight current segment, no matter its orientation in space.
Common Mistakes When Using the Right-Hand Rule
- Using the left hand by habit. The right-hand rule only works with the right hand for conventional current — switching hands flips the answer.
- Confusing the current-to-field rule with the force rule. There’s a second right-hand rule (thumb = current, fingers = field, palm push = force) used for calculating force on a wire in an external field — don’t mix the two up.
- Forgetting to use conventional current. If a diagram shows electron flow (negative to positive), you must either reverse the direction first or switch to your left hand.
- Misreading 2D diagrams. A dot (•) means the field points out of the page toward you; a cross (×) means it points into the page, away from you. Mixing these up is one of the most common exam errors.
Conventional Current vs. Electron Flow
Conventional current is defined as the direction positive charge would flow — from the positive terminal to the negative terminal of a battery. Electrons, which carry the actual charge in a metal wire, flow the opposite way. Physics and engineering formulas (including the right-hand rule) are built around conventional current, so it’s the standard to use unless a problem explicitly asks about electron flow.
Magnetic Field Shapes for Different Wire Configurations

Straight wires aren’t the only shape that matters. Bending or coiling a wire changes the field dramatically — and this is exactly how engineers concentrate magnetic fields for practical devices.
Straight Wire
Field forms simple concentric circles around the wire, weakening steadily with distance.
Circular Loop
Bending the wire into a loop concentrates the field lines through the center. The magnetic field at the center of a circular loop is:
B = μ₀I / 2R
where R is the loop’s radius. Notice this is similar to the straight-wire formula but valid only at the loop’s exact center.
Solenoid
A solenoid is a wire coiled into a tight helix with many turns. Because each turn’s field adds together, the field inside a solenoid becomes strong and remarkably uniform:
B = μ₀nI
where n is the number of turns per unit length. Outside the coil, the field is nearly zero — which is why solenoids make efficient electromagnets.
Toroid
A toroid is essentially a solenoid bent into a donut shape. Its field is confined almost entirely inside the coil’s loop, with virtually no external field — useful in transformers and inductors where stray fields are undesirable.
Comparison Table: Formulas at a Glance
| Configuration | Formula | Field Location | Typical Use |
|---|---|---|---|
| Straight wire | B = μ₀I / 2πr | Circles around the wire | Basic current-carrying conductors |
| Circular loop | B = μ₀I / 2R | Center of the loop | Simple electromagnets, sensors |
| Solenoid | B = μ₀nI | Uniform field inside the coil | Electromagnets, relays, MRI coils |
| Toroid | B = μ₀NI / 2πr | Confined inside the donut shape | Transformers, inductors |
Ampere’s Law vs. the Biot–Savart Law
Both laws calculate magnetic fields produced by current, but they’re suited to different situations.
When to Use Ampere’s Law
Ampere’s Circuital Law relates the magnetic field around a closed loop to the current passing through it. It’s the faster, cleaner method — but only when the current configuration has enough symmetry (straight wires, solenoids, toroids) to simplify the math.
When to Use the Biot–Savart Law
The Biot–Savart Law calculates the magnetic field contribution from every small segment of a wire, then sums (integrates) them. It works for any current shape, including irregular or asymmetric wires, but the math is more involved. Use it whenever a configuration lacks the symmetry Ampere’s Law needs.
Key takeaway: Reach for Ampere’s Law first when symmetry allows it; fall back on the Biot–Savart Law for anything irregular.
Force Between Two Parallel Current-Carrying Wires
Two current-carrying wires don’t just generate their own fields — they also exert force on each other, because each wire’s magnetic field acts on the moving charges in the other wire.
- Same direction currents: wires attract each other.
- Opposite direction currents: wires repel each other.
This interaction was historically significant enough that it was once used to formally define the ampere itself, before the unit was redefined using fundamental constants.
Real-World Applications
The physics of a current-carrying wire’s magnetic field isn’t just a classroom exercise — it’s the operating principle behind an enormous range of technology.
- Electric motors and generators: Motors use current-generated magnetic fields to produce rotational force; generators run the process in reverse, using motion to induce current.
- MRI machines: Powerful electromagnets built from current-carrying coils generate the strong, stable magnetic fields needed for medical imaging.
- Current sensors and clamp meters: These tools measure a wire’s magnetic field to determine current flow without ever touching the conductor.
- Electromagnets and relays: Solenoid-based electromagnets switch circuits on and off, lift heavy metal objects, and drive countless industrial and consumer devices.
- Speakers and induction cooktops: Both rely on current-generated magnetic fields interacting with other components to create sound or heat.
Measuring the Magnetic Field Around a Wire
Tools: Compass, Gaussmeter, Hall Effect Sensor
- Compass: The simplest tool — shows field direction but not precise strength.
- Gaussmeter/Teslameter: Dedicated instruments that measure field strength directly.
- Hall effect sensor: A small semiconductor device that outputs a voltage proportional to the magnetic field it detects, widely used inside current clamp meters and industrial sensors because it allows non-contact current measurement.
Units: Tesla vs. Gauss
The SI unit for magnetic field strength is the tesla (T). The older CGS unit, still common in some industries, is the gauss (G). The conversion is:
1 tesla = 10,000 gauss
Is the Magnetic Field Around Household Wiring Dangerous?
Household wiring carries relatively low current (typically 15–20 amps per circuit in the U.S.), which produces a magnetic field far weaker than fields from heavy industrial equipment or power transmission lines.
Health organizations, including the World Health Organization, have studied extremely low-frequency electromagnetic field (EMF) exposure extensively; current guidance is that typical residential exposure levels fall well below thresholds associated with established health effects, though research on long-term, low-level exposure continues.
If EMF exposure is a specific concern (for example, near high-voltage transmission lines), consulting current guidance from a recognized health authority is the appropriate next step rather than relying on general reassurance.
Common Mistakes to Avoid

- Confusing field strength’s relationship with distance. It’s inverse (1/r), not inverse-square (1/r²).
- Ignoring units. Mixing centimeters and meters in the formula is one of the most frequent calculation errors.
- Applying the loop formula to a straight wire, or vice versa. Each configuration has its own formula — they aren’t interchangeable.
- Forgetting that field direction reverses when current reverses. Reversing current flow flips the entire field direction, not just its strength.
- Overlooking superposition. When multiple wires are present, magnetic fields are vectors and must be added accordingly, not simply summed as plain numbers.
Frequently Asked Questions (FAQs)
What is the magnetic field of a current-carrying wire?
It’s the magnetic field generated around a wire whenever electric current flows through it, forming concentric circular field lines perpendicular to the wire.
What formula calculates the magnetic field around a straight wire?
B = μ₀I / 2πr, where B is field strength, μ₀ is the permeability of free space, I is current, and r is distance from the wire.
What is μ₀ and what is its value?
μ₀, the permeability of free space, is a constant equal to 4π × 10⁻⁷ T·m/A. It reflects how easily a magnetic field forms in a vacuum.
How do you find the direction of the magnetic field around a wire?
Use the right-hand rule: point your right thumb in the direction of current flow, and your curled fingers show the field’s circular direction.
Is there a difference between the right-hand rule for current and for force?
Yes. One rule (thumb = current, fingers = field direction) finds field direction around a wire. A separate rule (thumb = current, fingers = field, palm = force direction) finds the force on a wire in an external field.
Does the magnetic field depend on the wire’s material?
No — for a given current and distance, the field strength depends only on current and distance, not on whether the wire is copper, aluminum, or another conductor.
Does the magnetic field depend on the wire’s thickness or diameter?
Not directly in the standard formula, which treats the wire as an idealized thin conductor. Very thick wires require more advanced treatment for points inside the conductor itself.
Why does the magnetic field weaken as you move away from the wire?
Because field strength is inversely proportional to distance — as r increases, B decreases proportionally.
Is the relationship between distance and field strength inverse or inverse-square?
Inverse (1/r), unlike gravity or electric field from a point charge, which follow inverse-square relationships.
What happens to the magnetic field if you double the current?
The field strength doubles, since B is directly proportional to I.
What happens to the magnetic field if you reverse the current direction?
The field direction reverses, while its strength stays the same (assuming current magnitude is unchanged).
What is Oersted’s experiment and why is it significant?
In 1820, Hans Christian Oersted observed a compass needle deflect near a current-carrying wire, providing the first evidence linking electricity and magnetism and launching the field of electromagnetism.
How is Ampere’s Law used to find the magnetic field of a wire?
It relates the magnetic field around a closed loop to the total current enclosed by that loop, allowing quick calculation when the current configuration is symmetric.
What is the Biot–Savart Law and how does it differ from Ampere’s Law?
It calculates the magnetic field by summing contributions from every small current element along a wire, making it applicable to any shape — not just symmetric ones like Ampere’s Law requires.
When should you use Ampere’s Law instead of the Biot–Savart Law?
Use Ampere’s Law when the current configuration has enough symmetry (straight wires, solenoids, toroids) to simplify the calculation significantly.
What is the magnetic field at the center of a circular current loop?
B = μ₀I / 2R, where R is the loop’s radius.
What is the magnetic field inside a solenoid?
B = μ₀nI, where n is the number of coil turns per unit length — producing a strong, uniform field inside the coil.
What is the magnetic field of a toroid?
The field is confined almost entirely inside the donut-shaped coil, with negligible field outside it.
How do two parallel current-carrying wires interact magnetically?
Each wire’s magnetic field exerts a force on the other. Same-direction currents attract; opposite-direction currents repel.
Do parallel wires with current in the same direction attract or repel?
They attract.
How is the ampere historically defined using this force?
The ampere was originally defined based on the precise force per unit length between two parallel wires carrying equal current, before later being redefined using fundamental physical constants.
What is the difference between conventional current and electron flow in the right-hand rule?
Conventional current flows from positive to negative and is what the right-hand rule assumes; electron flow moves the opposite direction, requiring the left hand or a reversed current direction if used instead.
What is the SI unit of magnetic field strength?
The tesla (T).
How do you convert tesla to gauss?
Multiply by 10,000: 1 tesla equals 10,000 gauss.
What is a Hall effect sensor and how does it measure current?
It’s a semiconductor device that produces a voltage proportional to a nearby magnetic field, allowing current to be measured without direct electrical contact.
How does a clamp meter measure current without touching a wire?
It uses a Hall effect sensor (or similar technology) inside its jaw to detect the magnetic field generated by current flowing through the wire it clamps around.
Can a compass detect the magnetic field from a wire?
Yes — a compass needle will deflect and align with the field circling a current-carrying wire, as demonstrated in Oersted’s original experiment.
Is the magnetic field from household wiring dangerous to humans?
Typical residential wiring produces relatively weak magnetic fields at low current levels; established health guidance places common exposure levels well below thresholds of concern, though ongoing research continues to examine long-term low-level exposure.
What is electromagnetic interference (EMI) and how is it caused by current-carrying wires?
EMI occurs when the magnetic field from one current-carrying wire induces unwanted signals or noise in nearby circuits or devices.
How can you shield a wire or device from magnetic interference?
Common methods include twisted-pair cabling, increasing physical distance, and using shielding materials such as mu-metal around sensitive components.
What real-world devices rely on the magnetic field of current-carrying wires?
Electric motors, generators, MRI machines, current sensors, electromagnets, relays, speakers, and induction cooktops, among many others.
How does an electric motor use this principle?
A motor passes current through coils positioned in a magnetic field; the resulting force on the current-carrying wire produces rotational motion.
How does an MRI machine use magnetic fields from current?
Large current-carrying coils generate the strong, stable magnetic field needed to align and detect signals from hydrogen atoms in the body during imaging.
What is the difference between a magnetic field and an electric field around a wire?
A magnetic field is produced by moving charge (current) and circles the wire; an electric field is produced by charge itself (including stationary charge) and points radially outward from a charged conductor.
Does AC current create a different magnetic field pattern than DC current?
The field’s basic shape (concentric circles) is the same, but with AC current the field’s strength and direction continuously oscillate in step with the alternating current, unlike the steady field from DC.
What is magnetic flux density and how does it relate to magnetic field strength?
Magnetic flux density is another name for the magnetic field strength value (B), measured in tesla — the terms are commonly used interchangeably in this context.
What common mistake do students make when applying the right-hand rule?
Using the left hand instead of the right, or confusing the current-to-field rule with the separate current-to-force rule.
Why is the field around a wire circular instead of straight?
Because moving charge generates a field perpendicular to its direction of motion at every point, and by symmetry along an infinite straight wire, this produces field lines that form closed circles around it.
How do you calculate the magnetic field at a point due to two or more wires?
Calculate each wire’s individual field contribution at that point, then add them as vectors — accounting for both magnitude and direction — to find the net field.
Key Takeaways
- A current-carrying wire produces a magnetic field forming concentric circles around it, described by B = μ₀I / 2πr for a straight wire.
- Field direction is found with the right-hand rule: thumb in the direction of current, fingers curl in the direction of the field.
- Field strength scales directly with current and inversely with distance — not inverse-square.
- Coiling a wire into a loop, solenoid, or toroid reshapes and concentrates the field for practical use in electromagnets and inductors.
- This principle underlies motors, generators, MRI machines, current sensors, and countless everyday devices.
- Ampere’s Law is fastest for symmetric current configurations; the Biot–Savart Law handles any shape.