How to Find the Magnetic Field from a Long Straight Current-Carrying Wire Using Ampere's Law
Master magnetostatics with this complete walkthrough of calculating the magnetic field around a long straight wire. Learn how to apply Ampere's Law, choose the right Amperian loop, and understand why symmetry makes this problem solvable without integration.

📹 Video Walkthrough: This Exact Problem
Watch the full solution for finding the magnetic field from a long straight current-carrying wire step-by-step using Ampere's Law.
Table of Contents
The Problem
Find the magnetic field:
A long, straight wire carries a current I = 5.0 A in the +z direction. The wire is infinitely long and has negligible radius.
Find the magnitude and direction of the magnetic field at a point P located a distance r = 0.10 m from the wire.
Express your answer in terms of I, r, and the constant μ₀ = 4π × 10⁻⁷ T·m/A.
This is one of those classic E&M problems that shows up everywhere. You've got a current flowing through a wire, and you need to find the magnetic field it creates. It looks straightforward, but there are a lot of places to mess up.
The trick here is recognizing the symmetry. A lot of students jump straight into Biot-Savart Law integration without thinking about Ampere's Law. But with the right symmetry, Ampere's Law makes this problem trivial. If you're stuck on a similar problem, you can always generate a custom video solution on Torial.
Understanding Ampere's Law

Ampere's Law relates the magnetic field around a closed loop to the current passing through that loop. It's the magnetic equivalent of Gauss's Law for electric fields.
∮ B · dl = μ₀ I_enc
The line integral of B around a closed loop equals μ₀ times the current enclosed
Important things to remember:
Key points about Ampere's Law:
- B · dl is the dot product of the magnetic field and a small element along the loop
- I_enc is the total current passing through the loop (the area enclosed by the loop)
- The loop is arbitrary, but you choose it to make the integral easy
- Symmetry is key. If B is constant along the loop and parallel to dl, the integral becomes B × (length of loop)
- Current direction matters. Use the right-hand rule to determine the sign of I_enc
For our problem, we'll choose a circular Amperian loop centered on the wire. This makes B constant in magnitude and always parallel to dl, which simplifies the integral dramatically. If you need more help visualizing magnetic fields, check out other physics videos in our library.
Using Symmetry Arguments
Before you write down Ampere's Law, think about symmetry. This saves you from doing unnecessary work and tells you what the field looks like.
💡 Key Insight: For an infinitely long straight wire, the magnetic field has cylindrical symmetry. The field strength depends only on the distance r from the wire, not on the angle or position along the wire.
The field lines form circles around the wire. The magnitude B(r) is constant at any fixed distance r, and the direction is always tangent to these circles.
Why does this matter? Because it means you can choose a circular Amperian loop at radius r, and B will be constant along that entire loop. The field is also parallel to dl everywhere on the loop, so B · dl = B dl (no cosine needed).
What the symmetry tells us:
Constant magnitude:
B(r) is the same at all points distance r from the wire
Tangential direction:
B is always perpendicular to the radial direction, tangent to circles
This is the kind of thing that separates students who finish in 5 minutes from students who grind through Biot-Savart integration. Use symmetry. Always.
Choosing the Right Amperian Loop
The choice of Amperian loop is crucial. You want a loop where B is constant and parallel to dl everywhere.
For a long straight wire:
Choose a circular loop of radius r centered on the wire, lying in a plane perpendicular to the wire.
Loop: Circle of radius r, centered on wire
This loop has the property that B is constant (magnitude B(r)) and parallel to dl everywhere along it.

Why this loop works:
- B is constant in magnitude along the entire loop (by symmetry)
- B is always parallel to dl (both are tangent to the circle)
- The loop encloses the full current I
- The circumference is 2πr, which is easy to work with
Notice how we're using the symmetry to our advantage. The circular loop matches the circular field lines, so everything aligns perfectly. This is why Ampere's Law is so powerful for symmetric current distributions.
Applying Ampere's Law
Now we evaluate the left side of Ampere's Law: ∮ B · dl. Because of our smart choice of loop, this becomes simple.
Step 1: Evaluate the line integral
Since B is constant and parallel to dl everywhere on the loop:
∮ B · dl = ∮ B dl = B ∮ dl
The integral of dl around a circle is just the circumference:
∮ dl = 2πr
Therefore: ∮ B · dl = B × 2πr
Step 2: Find the enclosed current
The circular loop encloses the entire wire, so:
I_enc = I = 5.0 A
The current is flowing in the +z direction. Using the right-hand rule, this gives a positive contribution to the integral.
⚠️ Check your work: Make sure you're using the right sign for the current. The right-hand rule tells you the direction of the field, and the sign of I_enc determines whether the integral is positive or negative.
For a current in the +z direction, curl your right-hand fingers around the wire in the direction of the current. Your thumb points in the +z direction, and your fingers curl in the direction of B.
See how the symmetry made the integral trivial? Without it, you'd be doing a complicated line integral. With it, B just factors out and you're left with the circumference. Want to see more worked examples? Browse through hundreds of physics solutions on Torial.
Calculating the Magnetic Field

Now we set the left side equal to the right side of Ampere's Law and solve for B.
Ampere's Law:
∮ B · dl = μ₀ I_enc
B × 2πr = μ₀ I
B = μ₀ I / (2πr)
Substituting our values:
B = (4π × 10⁻⁷ T·m/A) × (5.0 A) / (2π × 0.10 m)
B = (4π × 10⁻⁷ × 5.0) / (2π × 0.10) T
B = (2 × 10⁻⁶) / (0.10) T
B = 2.0 × 10⁻⁵ T = 20 μT
Final Answer (Magnitude):
B = μ₀ I / (2πr) = 20 μT
The magnetic field at a distance r = 0.10 m from a wire carrying I = 5.0 A is 20 microteslas.
What this tells us:
- The field is inversely proportional to distance: B ∝ 1/r
- Doubling the distance halves the field strength
- The field is proportional to the current: B ∝ I
- For a 5 A current at 10 cm, the field is about 40 times stronger than Earth's magnetic field (~0.5 mT)
- The field decreases as you move away from the wire, but never goes to zero
Notice how the π's canceled out in the calculation. That's common with circular symmetry problems. Also, the units work out: (T·m/A) × A / m = T, which is correct for magnetic field.
Finding the Direction with Right-Hand Rule
Ampere's Law gives us the magnitude, but we need the right-hand rule to find the direction.
Right-hand rule for straight wires:
Point your right thumb in the direction of the current. Your fingers curl in the direction of the magnetic field.
For our problem:
- Current: +z direction (pointing up/out of page)
- Point right thumb in +z direction
- Fingers curl counterclockwise when viewed from above
- Magnetic field is tangent to circles, counterclockwise
💡 Visual check: If the wire is vertical and current flows upward, the field lines form circles around the wire. When viewed from above, these circles go counterclockwise.
At point P (to the right of the wire), the field points into the page (or downward, depending on your coordinate system).
The direction is just as important as the magnitude. On exams, you'll lose points if you get the magnitude right but the direction wrong. Always use the right-hand rule to check.
Common Mistakes to Avoid
Here are the mistakes that cost students the most points. Learn them now so you don't make them on test day. If you want personalized help avoiding these errors, create a custom study video for your specific problem.
❌ Mistake #1: Using the Wrong Amperian Loop
Choosing a square or rectangular loop instead of a circle. This makes B · dl complicated because B changes direction along the loop.
Fix: Always match the loop to the symmetry. For cylindrical symmetry, use a circle. For planar symmetry, use a rectangle.
❌ Mistake #2: Forgetting the 2π in the Circumference
Writing ∮ dl = r or ∮ dl = πr instead of 2πr. The circumference of a circle is 2πr, not πr (that's the area).
Fix: Remember: circumference = 2πr, area = πr². You're integrating around the perimeter, not finding the area.
❌ Mistake #3: Using the Wrong Current
Using the total current in the circuit instead of the current enclosed by the loop. Or forgetting that only current passing through the loop counts.
Fix: I_enc is only the current that passes through the area enclosed by your Amperian loop. Current outside the loop doesn't contribute.
❌ Mistake #4: Getting the Sign Wrong
Not using the right-hand rule correctly to determine the direction, or mixing up the sign of I_enc. Current direction matters.
Fix: Use the right-hand rule consistently. Thumb in direction of current, fingers curl in direction of B. The sign of I_enc should match this.
❌ Mistake #5: Not Recognizing When Ampere's Law Applies
Trying to use Ampere's Law when there's no symmetry, or using Biot-Savart when Ampere's Law would be easier.
Fix: Ampere's Law works best with high symmetry (cylindrical, planar, etc.). If there's no symmetry, you need Biot-Savart or numerical methods.
❌ Mistake #6: Confusing B · dl with B dl
Not recognizing when B is parallel to dl, so B · dl = B dl. If B and dl aren't parallel, you need the dot product with cos θ.
Fix: Only when B is constant and parallel to dl everywhere on the loop can you write B · dl = B dl. Otherwise, you need the full dot product.
❌ Mistake #7: Units Errors
Forgetting μ₀ = 4π × 10⁻⁷ T·m/A, or mixing up the units. Getting the wrong power of 10 in the final answer.
Fix: Always check units. B should be in teslas (T). μ₀ has units T·m/A. Make sure your final answer has the right units.
Practice Problems with Video Solutions
Best way to get good at this? Practice. Try these similar problems and check your work with video solutions. You can also generate instant video explanations for any physics problem you're working on.
Practice Problem 1: Different Current
A long straight wire carries I = 10.0 A. Find the magnetic field at r = 0.05 m from the wire.
Hint: Same process, different numbers. Your answer should be 40 μT.
Get instant video solution on Torial →Practice Problem 2: Coaxial Cable
A coaxial cable has a central wire carrying I = 3.0 A and an outer conductor carrying -3.0 A (equal and opposite). Find B outside the cable (r > outer radius).
Hint: The net enclosed current is zero outside. B = 0 outside a coaxial cable.
Get instant video solution on Torial →Practice Problem 3: Solenoid
A long solenoid with n turns per meter carries current I. Find the magnetic field inside the solenoid.
Hint: Use a rectangular Amperian loop. B inside = μ₀ n I, B outside ≈ 0.
Get instant video solution on Torial →Practice Problem 4: Toroid
A toroid (donut-shaped) has N turns and carries current I. The inner radius is a and outer radius is b. Find B inside the toroid.
Hint: Use a circular Amperian loop inside the toroid. B = μ₀ N I / (2πr), where r is the distance from the center.
Get instant video solution on Torial →When to Use Ampere's Law vs. Biot-Savart Law
Should you always use Ampere's Law, or do you sometimes need Biot-Savart?
✓ Use Ampere's Law When:
- There's high symmetry (cylindrical, planar, etc.)
- You can choose a loop where B is constant
- The current distribution is symmetric
- You want a quick calculation
- Examples: straight wire, solenoid, toroid, infinite sheet
✓ Use Biot-Savart When:
- There's no symmetry
- The current is in a finite segment
- You need the field at a specific point
- The geometry is irregular
- Examples: finite wire, current loop, arbitrary shape
For this problem? Ampere's Law wins big. The infinite straight wire has perfect cylindrical symmetry, so a circular loop makes the integral trivial. Using Biot-Savart would require integration over the entire wire, which is much more work. When you're juggling multiple concepts, it helps to have a step-by-step video walkthrough that shows exactly which method to use when.
Other Videos
Explaining AI-Driven Flavor Creation Chemistry Models
Calculating New Allele Frequencies After Selection
Launching Rockets Near the Equator
How AI Boosts Learning with Spaced Repetition
Stuck on a Different Problem?
Get instant, personalized video explanations for your homework
Create Your First VideoRelated Articles
How to Find the Electric Field from a Uniformly Charged Ring Along Its Axis
Learn electric field calculations with this complete walkthrough. Learn the integration setup, avoid common vector mistakes, and understand symmetry arguments.

How to Find the Range and Maximum Height of a Projectile Launched at an Angle
Learn kinematics with this complete walkthrough of projectile motion. Decompose velocity into components and use the kinematic equations.
