Ampere’s Law Calculator | Calculate Magnetic Field Strength


Ampere’s Law Calculator

This tool demonstrates how Ampere’s law can be used to calculate the magnetic field for common symmetrical current configurations.


Choose the shape of the current-carrying conductor.


Enter the total current in Amperes (A).


Enter the distance from the center in meters (m).

Magnetic Field Strength (B)
2.00e-5 T

Permeability of Free Space (μ₀):

1.26e-6 T·m/A

Enclosed Current (I_enc):

10.00 A

Formula for Long Straight Wire: B = (μ₀ * I) / (2 * π * r)

Chart of Magnetic Field (B) vs. Distance (r) for a Long Straight Wire. B is shown in Tesla (T) and r is in meters (m).

What Does Ampere’s Law Calculate?

At its core, Ampere’s law can be used to calculate the magnetic field generated by a steady electric current. It is a fundamental principle of electromagnetism and forms one of the four famous Maxwell’s Equations. The law relates the integrated magnetic field around a closed loop, called an “Amperian loop,” to the total electric current that passes through the surface enclosed by that loop.

This law is most powerful when applied to problems with a high degree of symmetry. For geometries like an infinitely long straight wire, an ideal solenoid, or a toroid, Ampere’s law simplifies the calculation of the magnetic field strength (B) dramatically, making it much easier than using the more general Biot-Savart Law.

Who Uses This Calculation?

Engineers, physicists, and students use this principle to design and analyze electromagnets, motors, transformers, inductors, and other devices where magnetic fields are critical. Understanding how Ampere’s law can be used to calculate fields is essential for anyone studying electricity and magnetism.

The Ampere’s Law Formula and Explanation

The integral form of Ampere’s Circuital Law is written as:

∮ B ⋅ dl = μ₀ * I_enc

Where:

  • ∮ B ⋅ dl is the line integral of the magnetic field (B) around a closed path (Amperian loop).
  • μ₀ (mu-naught) is the magnetic constant, also known as the permeability of free space (approximately 4π × 10⁻⁷ T·m/A).
  • I_enc is the total net electric current enclosed by the path.

For symmetrical cases, this integral simplifies to an algebraic equation. Our calculator uses these simplified forms:

Variable Meaning Unit (SI) Typical Range
B Magnetic Field Strength Tesla (T) 10⁻⁹ T to 10 T
I Electric Current Amperes (A) 0.1 A to 1000 A
r Radial Distance meters (m) 0.001 m to 10 m
N Number of Turns (unitless) 10 to 10,000
L Length of Solenoid meters (m) 0.01 m to 2 m
μ₀ Permeability of Free Space T·m/A Constant (1.2566… × 10⁻⁶)
Variables involved when Ampere’s law can be used to calculate magnetic fields.

Practical Examples

Example 1: Field from a Power Line

Imagine a long, straight power line carrying a current. We want to find the magnetic field at a certain distance away.

  • Inputs: Geometry = Long Straight Wire, Current (I) = 150 A, Distance (r) = 10 m.
  • Calculation: Using B = (μ₀ * I) / (2 * π * r), we find the magnetic field.
  • Result: The magnetic field strength B is approximately 3.0 × 10⁻⁶ T, or 3 microteslas. This shows how quickly the field drops off with distance. A deep dive into this topic can be found in our article on the magnetic field of a wire.

Example 2: Inside an MRI Solenoid

An MRI machine uses a powerful solenoid to generate a strong, uniform magnetic field. Let’s see how Ampere’s law can be used to calculate this field.

  • Inputs: Geometry = Solenoid, Current (I) = 200 A, Total Turns (N) = 2000, Length (L) = 1.5 m.
  • Calculation: First, find turns per unit length n = N / L = 2000 / 1.5 ≈ 1333 turns/m. Then, use B = μ₀ * n * I.
  • Result: The magnetic field strength B is approximately 0.335 T. Real MRI machines use much higher fields, often requiring superconducting wires. The concept of calculating magnetic flux is closely related.

How to Use This Ampere’s Law Calculator

Using this tool is straightforward and provides instant insight into magnetic fields.

  1. Select Geometry: Start by choosing the shape of your current source from the dropdown menu (e.g., Long Straight Wire, Solenoid).
  2. Enter Inputs: The required input fields will appear. For example, for a wire, you need to provide the current and distance. For a solenoid, you’ll also need the number of turns and length. Ensure you are using the correct SI units as specified (Amperes, meters).
  3. Analyze Results: The calculator instantly updates the magnetic field strength (B) in Tesla (T). Intermediate values are also shown to provide more context for the calculation.
  4. Interpret the Chart: The chart dynamically visualizes how the magnetic field changes with distance for the selected configuration, a key concept when learning how Ampere’s law can be used to calculate field behavior.

Key Factors That Affect the Magnetic Field

Several factors directly influence the outcome of the calculation. Understanding them is key to understanding Maxwell’s equations on a deeper level.

  • Current Magnitude (I): This is the most direct factor. The magnetic field strength is directly proportional to the current. Double the current, and you double the magnetic field.
  • Distance (r): For wires and toroids, the magnetic field strength is inversely proportional to the distance from the center. The further away you are, the weaker the field.
  • Turn Density (n = N/L): For solenoids, this is a critical factor. A higher number of turns packed into a smaller length creates a much stronger and more uniform magnetic field inside.
  • Geometry: The shape of the conductor is fundamental. A tightly wound solenoid concentrates the field inside, while a straight wire’s field spreads out in concentric circles.
  • Core Material (Permeability): This calculator assumes the medium is a vacuum (or air, which is very similar), using μ₀. If you introduce a ferromagnetic material like iron inside a solenoid, the magnetic field is amplified by a huge factor (μ = μᵣ * μ₀).
  • Symmetry: The reason Ampere’s law can be used to calculate these fields so easily is the high degree of symmetry. For irregular shapes, the calculation becomes vastly more complex, often requiring the Biot-Savart Law vs Ampere’s Law approach.

Frequently Asked Questions (FAQ)

1. What is the difference between Ampere’s Law and the Biot-Savart Law?

Both laws calculate magnetic fields from currents. Ampere’s Law is simpler and used for highly symmetric situations (long wires, solenoids). The Biot-Savart Law is more fundamental and can be used for any wire shape but involves a more complex vector integral.

2. Why is the magnetic field outside an ideal solenoid considered zero?

In an infinitely long, ideal solenoid, the magnetic field lines are perfectly contained within the coil. The fields from the top and bottom wires cancel each other out in the exterior region. In real solenoids, there is a very weak “fringe field” outside.

3. What units does this calculator use?

This calculator strictly uses SI units: Amperes (A) for current, meters (m) for distance and length, and outputs the magnetic field in Tesla (T).

4. Can Ampere’s law be used to calculate the field of a finite-length wire?

Not easily. A finite wire lacks the infinite symmetry that simplifies the Amperian loop integral. For a finite wire, the Biot-Savart law is the appropriate tool.

5. What is I_enc (enclosed current)?

It’s the net current passing through the imaginary surface bounded by your Amperian loop. If two wires pass through carrying current in opposite directions, you would use the net difference (I₁ – I₂).

6. Does this calculator work for alternating current (AC)?

No. This version of Ampere’s law is for magnetostatics, meaning steady currents (DC). For time-varying fields (like AC), you must use the full Maxwell-Ampère equation, which includes a “displacement current” term. This is a more advanced topic covered under electrodynamics basics.

7. Why is the field inside a toroid not uniform?

Unlike an ideal solenoid, the field inside a toroid varies with the radial distance ‘r’ from the center. The formula B = (μ₀ * N * I) / (2 * π * r) shows that the field is stronger on the inner side (smaller r) and weaker on the outer side (larger r).

8. What is the permeability of free space (μ₀)?

It’s a physical constant that represents the ability of a classical vacuum to support the formation of a magnetic field. It’s the magnetic equivalent of the electrical permittivity of free space (ε₀). A guide to what is permeability can provide more detail.

© 2026 Physics Calculators Inc. All calculations are for educational purposes. Consult a professional for critical applications.



Leave a Reply

Your email address will not be published. Required fields are marked *