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.
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.
| Case | Setup | B | Compared with Earth's field |
|---|
Typical magnetic field strengths
| Source | Typical B | In gauss |
|---|
Values are typical or approximate and vary widely between sources.
Relative permeability μr (approximate)
| Material | Typical μr |
|---|
Constants and unit reference
| Quantity | Value |
|---|---|
| μ₀ (vacuum permeability) | 1.25663706 × 10⁻⁶ H/m (≈ 4π × 10⁻⁷) |
| 1 gauss | 10⁻⁴ T = 100 µT |
| 1 oersted | 79.5775 A/m |
| 1 tesla | 1 N / (A·m) = 10,000 G |
| 1 inch | 0.0254 m |
| B and H | B = μ₀ μr H |
Validation and sources
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
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| Parameter | Value |
|---|---|
| I | 10 A |
| r | 0.1 m |
| μ₀ | 4π×10⁻⁷ H/m |
| Formula | B = (μ₀·I) / (2π·r) |
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
Related calculators · Magnetics
Recently updated formulas
Suggest an improvement
Found a mistake? Have a better example? Let us know.
You may send up to 3 suggestions per 24 hours.