Key facts
- A long straight wire produces B = μ₀I/(2πr): 10 A gives 40 μT at 5 cm.
- A circular loop produces B = μ₀NI/(2R) at its centre and B = μ₀NIR²/[2(R² + z²)^(3/2)] on its axis.
- An ideal solenoid has a uniform interior field B = μ₀nI (n = turns per metre); at the end of a long solenoid B drops to about half.
- A Helmholtz coil (spacing = radius) gives B = (4/5)^(3/2) μ₀NI/R ≈ 0.7155 μ₀NI/R with a very uniform central region.
- A toroid confines the field inside: B = μ₀NI/(2πr) for a < r < b and zero outside (ideal winding).
- μ₀ = 1.25663706127 × 10⁻⁶ N/A² (CODATA 2022), measured since the 2019 SI revision; 1 T = 10⁴ G.
Magnetic Field Calculator
Meridional plane of a single loop (axis vertical, loop cross-section shown as two dots). Colour is |B| on a log scale; arrows show field direction. Computed with complete elliptic integrals.
Magnetic Field Formulas for Each Configuration
The Biot–Savart Law
The Biot–Savart law gives the magnetic field produced by a steady current as a sum over infinitesimal current elements:
It is the magnetostatic counterpart of Coulomb's law: the field falls as 1/r² from each element and is perpendicular to both the current element and the line joining it to the field point. Every formula in the table above is an exact integral of this law for a particular shape. To check them, we integrated the Biot–Savart law numerically (hundreds of thousands of segments, including a 200-turn helix for the solenoid) and found agreement to better than one part in a million.
Direction follows the right-hand rule: point the thumb along the current and the fingers curl in the direction of B. For a loop, curl the fingers with the current and the thumb points along B through the centre.
Ampère's Circuital Law
When symmetry makes |B| constant along a chosen loop, Ampère's law gives the field in one line. For a long wire, a circle of radius r gives \(B\cdot 2\pi r=\mu_0 I\). For a toroid, a circle inside the core encloses N turns, so \(B\cdot2\pi r=\mu_0NI\). For an ideal solenoid, a rectangular loop gives \(BL=\mu_0NI\). Loops and finite solenoids lack this symmetry, which is why they need Biot–Savart. Maxwell later added the displacement current term, see Maxwell's equations explained.
Worked Examples
1. Long wire: 10 A at 5 cm
\(B=\mu_0I/(2\pi r)=1.2566\times10^{-6}\times10/(2\pi\times0.05)=4.00\times10^{-5}\) T = 40.0 μT (0.400 G). This is comparable to Earth's field, which is why Ørsted's 1820 compass needle deflected near a current.
2. Solenoid: N = 500, L = 25 cm, R = 2 cm, I = 2 A
Ideal: \(B=\mu_0(500/0.25)(2)=5.027\) mT. Finite solenoid at the centre: 4.963 mT (1.3% lower). At the end face (z = L/2): 2.505 mT, essentially half of the centre value.
3. Helmholtz coil: N = 100 per coil, R = 15 cm, I = 1 A
\(B_0=0.7155\times\mu_0\times100\times1/0.15=\) 0.599 mT (5.99 G) at the centre.
4. Toroid: N = 400, I = 3 A, mean radius 10 cm, air core
\(B=\mu_0\times400\times3/(2\pi\times0.10)=\) 2.40 mT at r = 10 cm, and zero outside the winding.
Each example is one click away: choose the configuration above and enter the values to see the substituted formulas.
Units and Typical Magnetic Field Strengths
| Quantity | SI unit | Conversions |
|---|---|---|
| Magnetic flux density B | tesla (T) = Wb/m² = N/(A·m) | 1 T = 10⁴ G; 1 μT = 0.01 G = 1000 nT |
| Magnetic field strength H | A/m | In vacuum/air H = B/μ₀; 1 Oe = 1000/(4π) A/m ≈ 79.58 A/m |
| Magnetic flux Φ | weber (Wb) = T·m² | 1 Wb = 10⁸ maxwell |
| Source | Typical B |
|---|---|
| Earth's magnetic field at the surface | ≈ 25 – 65 μT |
| 10 A wire at 5 cm (Example 1) | 40 μT |
| Laboratory Helmholtz coil (Example 3) | ≈ 0.6 mT |
| Clinical MRI scanner | 1.5 T or 3 T |
Assumptions and Limits
Steady (DC) currents
Magnetostatics. For fast-changing currents, retardation and induced fields matter (see Faraday's law).
Thin conductors
Wires are treated as lines; inside a thick wire B grows linearly with r up to its surface.
Vacuum or air
μr = 1 except for the toroid option. Ferromagnetic cores in open solenoids need demagnetisation analysis, not a simple μr factor.
Solenoid as a current sheet
Accurate on the axis when the winding is tight; very close to the wires the discrete turns cause ripple.
Related Tools and Guides
Frequently Asked Questions
What is the magnetic field around a long straight wire?
B = μ₀I/(2πr), where I is the current and r the perpendicular distance from the wire. The field lines are circles around the wire, with direction given by the right-hand rule. For 10 A at 5 cm, B ≈ 4.0 × 10⁻⁵ T (40 μT), similar to Earth's magnetic field.
How do you calculate the magnetic field inside a solenoid?
For a long solenoid, B = μ₀nI, where n = N/L is the number of turns per metre. For a solenoid of finite length on its axis, B(z) = (μ₀nI/2)[cos θ₁ − cos θ₂], written in this calculator in terms of the distances to both ends. At the ends of a long solenoid the field is about half of the central value.
What is the magnetic field at the centre of a circular loop?
B = μ₀NI/(2R) for N turns of radius R carrying current I. On the axis at distance z from the centre, B = μ₀NIR²/[2(R² + z²)^(3/2)]. Off the axis the field requires complete elliptic integrals, which this calculator evaluates exactly.
Why is a Helmholtz coil so uniform?
Two identical coaxial loops separated by a distance equal to their radius make the first and second derivatives of the axial field (and, by symmetry, the third) zero at the midpoint. The field at the centre is B = (4/5)^(3/2) μ₀NI/R ≈ 0.7155 μ₀NI/R.
Is μ₀ exactly 4π × 10⁻⁷ H/m?
Not any more. Since the 2019 revision of the SI, μ₀ is an experimentally determined constant. The CODATA 2022 value is 1.25663706127(20) × 10⁻⁶ N/A², which differs from 4π × 10⁻⁷ by about one part in 10¹⁰. This calculator uses the CODATA value; the difference is negligible in engineering.
How do I convert tesla to gauss?
1 tesla = 10,000 gauss, so 1 mT = 10 G and 1 μT = 0.01 G. The tesla is the SI unit; the gauss is the CGS unit still common in magnet datasheets and geophysics (where the nanotesla is also used).
What is the difference between B and H?
B (magnetic flux density, tesla) is the field that exerts force on moving charges. H (magnetic field strength, A/m) is related to free currents through Ampère's law. In vacuum or air B = μ₀H; inside magnetic materials B = μ₀(H + M).
References
Tiesinga, E., Mohr, P. J., Newell, D. B., & Taylor, B. N. (2025). CODATA recommended values of the fundamental physical constants: 2022. Reviews of Modern Physics / NIST. physics.nist.gov/cuu/Constants
Griffiths, D. J. (2017). Introduction to Electrodynamics (4th ed.), Chapter 5: Magnetostatics. Cambridge University Press.
Jackson, J. D. (1999). Classical Electrodynamics (3rd ed.), Section 5.5 (field of a circular current loop). Wiley.
Ling, S. J., Sanny, J., & Moebs, W. (2016). University Physics Volume 2, Chapter 12: Sources of Magnetic Fields. OpenStax. openstax.org
Simpson, J. C., Lane, J. E., Immer, C. D., & Youngquist, R. C. (2001). Simple Analytic Expressions for the Magnetic Field of a Circular Current Loop. NASA Technical Memorandum, Kennedy Space Center.
Cite this tool: Ghimire, B. (2026). Magnetic Field Calculator: Wire, Loop, Solenoid & Helmholtz Coil. Engineers Views. https://engineersviews.com/tools/magnetic-field-calculator/