Formula & Calculator

Ampere's Law

Ampere's Law says that if you draw a closed loop around a current-carrying wire, the magnetic field circulating around that loop is proportional to the total current passing through the loop. It is a magnetic counterpart to Gauss's Law. You use it to calculate magnetic fields of symmetric arrangements, like a long straight wire or a solenoid, without doing complicated integrals.

Magnetics Magnetostatics
ELECTROMAGNETISM TOOLS · MAGNETIC FIELD FROM CURRENT

Ampère's Law Calculator

Solve for magnetic field, current or distance for a straight wire, a thick conductor, a solenoid or a toroid. Includes unit conversion, a circuit diagram, field-line diagrams, charts and reference tables.

∮ B·dl = μ₀ · Ienc
Geometry
Solve for
Current (I)SOLVED
1 µA100 kA
Current must be greater than 0.
Distance from axis (r)SOLVED
0.1 mm1 km
Distance must be greater than 0.
Conductor radius (a)
Radius must be greater than 0.
Number of turns (N)
turns
Turns must be greater than 0.
Solenoid length (L)
Length must be greater than 0.
Magnetic field (B)SOLVED
0.1 nT100 T
Field must be greater than 0.
Core material
Relative permeability (μr)
1 = air or vacuum
μr must be greater than 0.
MAGNETIC FIELD (B)
—µT
Step-by-step solution
Ampère's law and unit conversions
Field vs distance
Byour point
Where your field sits (log scale)
Sensitivity
Circuit diagram · the current path
Field diagram · Amperian loop and B lines

Choose a symmetric loop

Ampère's law is easy when the loop follows the field: a circle round a wire, or a rectangle through a solenoid. Then B·ℓ = μ₀ Ienc.

Only enclosed current counts

Current outside the loop adds no net circulation. Inside a thick wire the enclosed current grows with r², so B rises linearly with r.

Direction: right-hand rule

Point your right thumb along the current. Your fingers curl in the direction of B.

Ideal cases only

Formulas assume an infinitely long wire or solenoid and a closely wound toroid. Real finite coils and iron saturation change the result.

How to Use This Calculator

Ampère's law links the circulation of B around a closed loop to the current passing through it. Pick a geometry, choose what to solve, enter the rest and read the result.

1. Choose a geometry

Long straight wire, thick cylindrical conductor, solenoid or toroid. Only the inputs that apply to that geometry are shown.

2. Choose what to solve for

B (the field), I (the current needed for a field) or r (the distance where a field has a given strength).

3. Enter your values

Type a number, tap a preset, or drag the slider under each field. Sliders are logarithmic so one drag covers microamps to kiloamps.

4. Pick the units

Current in µA to kA, lengths in mm, cm, m or inches, field in nT, µT, mT, T or gauss. Values convert when you change a unit.

5. Calculate and read the result

Press Calculate & show result. It scrolls to the result card with the answer, the step-by-step math, ∮B·dl, H, energy density and the field in every unit.

6. Study the diagrams, or load a real case

Advanced is on by default: add a core permeability, see the circuit and field diagrams, and compare with Earth's field. Use Basic for a simpler view, or load an example from the tables below.

What This Tool Offers

Built on Ampère's circuital law, ∮B·dl = μ₀ Ienc, applied to four classic symmetric geometries.

Solve in any direction

Find B, current or distance. Each step shows the loop length, enclosed current and the law applied.

Unit conversion

µA to kA, mm to inches, nT to tesla and gauss, plus H in A/m and oersted and energy density in J/m³.

Type, preset or drag

Every input has quick presets and a draggable slider for fast "what if" exploration.

Circuit and field diagrams

A circuit schematic of the current path and a drawn Amperian loop with B lines, redrawn for each geometry.

Charts and field scale

A B-versus-distance (or current) curve with your point, and a log scale placing your field among Earth, magnets and MRI.

Real examples and references

House wiring, power lines, lightning, lab solenoids and toroids, plus typical field strengths and permeability values.

Real-world examples

Typical cases with B computed from Ampère's law (ideal geometry, air unless noted). Click Load to try one.

CaseSetupBCompared with Earth's field

Typical magnetic field strengths

SourceTypical BIn gauss

Values are typical or approximate and vary widely between sources.

Relative permeability μr (approximate)

MaterialTypical μr

Constants and unit reference

QuantityValue
μ₀ (vacuum permeability)1.25663706 × 10⁻⁶ H/m (≈ 4π × 10⁻⁷)
1 gauss10⁻⁴ T = 100 µT
1 oersted79.5775 A/m
1 tesla1 N / (A·m) = 10,000 G
1 inch0.0254 m
B and HB = μ₀ μr H

Validation and sources

Ampère's circuital law: ∮ B·dl = μ₀ μr I_enc (static currents)
Wire: B = μ₀ I / 2πr · Solenoid: B = μ₀ N I / L · Toroid: B = μ₀ N I / 2πr
μ₀ value from CODATA 2018
Every result is cross-checked by recomputing ∮B·dl = B · ℓ

Field strengths and permeabilities on this page are typical values, not specifications of a particular product.

Formulas

B = μ₀ μr I_enc / ℓ (ℓ = Amperian path length)
Wire: ℓ = 2πr, I_enc = I · Thick wire, r < a: I_enc = I · r²/a²
Toroid: ℓ = 2πr, I_enc = N I · Solenoid: ℓ = L, I_enc = N I
H = B / (μ₀ μr) · Energy density u = B² / (2 μ₀ μr)

Results are idealised estimates for learning and quick checks.

Variables

Symbol Quantity Unit
B Magnetic flux density T
μ₀ Permeability of free space (4π×10⁻⁷) H/m
I_enc Enclosed electric current A
N Number of turns (for solenoids/toroids) dimensionless
r Radius of Amperian loop (wire/toroid) m
L Length of solenoid m

What it means

Ampere’s law states that the line integral of the magnetic field B around a closed path is equal to μ₀ times the total current enclosed by the path. Mathematically, ∮ B·dl = μ₀·I_enc. It is one of Maxwell’s equations and is the magnetic counterpart of Gauss’s law for electricity. Ampere’s law is used to calculate magnetic fields for symmetric current distributions, such as those from long straight wires, solenoids, and toroids. For a long straight wire carrying current I, the magnetic field at distance r is B = μ₀I/(2πr). This law is fundamental in electromagnetism and is used in the design of magnetic circuits, transformers, and inductors. Example: For a long straight wire with I=10A, the magnetic field at r=0.1m is B = (4π×10⁻⁷ * 10) / (2π * 0.1) = (4π×10⁻⁶)/(0.2π) = 2×10⁻⁵ T (20 µT).

Worked example

Ampere's Law – Practical Example

Real‑World
Scenario: A long straight wire carries a current of 10 A. Find the magnetic field at a distance of 0.1 m from the wire.
ParameterValue
I10 A
r0.1 m
μ₀4π×10⁻⁷ H/m
FormulaB = (μ₀·I) / (2π·r)
1Substitute: B = (4π×10⁻⁷ × 10) / (2π × 0.1)
2Simplify: B = (2×10⁻⁶) / 0.1 = 2×10⁻⁵ T
Final Design B = 20 µT ✓ Magnetic field
Why: Ampere's law relates the magnetic field around a wire to the current – it is the magnetic analog of Gauss's law for electricity.

Common mistakes

  • Closed loop: The line integral is around a closed path.
  • Current enclosed: Only currents passing through the surface bounded by the loop.
  • Sign: Use the right‑hand rule for current direction relative to the loop.
  • Displacement current: For time‑varying fields, add displacement current term (Maxwell’s correction).
  • Magnetic permeability μ₀: For media, use μ.

Applications

Ampere's law relates the circulation of the magnetic field around a closed loop to the enclosed current, forming the basis for magnetostatics. Engineers use it to design electromagnets, motors, and inductors, calculating the field produced by current‑carrying conductors. It is also used to analyse the magnetic field of transmission lines and to design magnetic shielding. By applying Ampere's law, professionals can determine the field distribution in symmetric geometries, essential for magnetic circuit design. This law is one of Maxwell's equations and is fundamental to electrical engineering.

  • Design of electromagnets and magnetic actuators
  • Motor and transformer magnetic circuit analysis
  • Transmission line magnetic field assessment
  • Magnetic shielding and EMC design
  • Educational foundation of magnetic fields