Magnetic Field Calculator
Current Doesn't Just Flow — It Radiates
Any current-carrying conductor generates a magnetic field around it, a fact Hans Christian Ørsted discovered by accident in 1820 when a compass needle near his circuit refused to sit still. The field's shape and strength depend entirely on the conductor's geometry — a straight wire, a loop, and a coiled solenoid each produce a different pattern from the same current. This calculator handles all three.
The Formulas
Center of a circular loop: B = (μ0 × I) / (2 × R)
Inside a solenoid: B = μ0 × n × I, where n = N / L
B is magnetic flux density in tesla, I is current in amps, r or R is distance/radius in meters, N is number of turns, L is coil length in meters, and μ0 is the permeability of free space, 4π × 10-7 T·m/A.
Worked Examples
| Configuration | Inputs | Result |
|---|---|---|
| Straight wire | I = 10 A, r = 0.05 m | 4.0 × 10-5 T |
| Circular loop center | I = 5 A, R = 0.1 m | 3.14 × 10-5 T |
| Solenoid | I = 2 A, N = 500 turns, L = 0.2 m | 6.28 × 10-3 T |
Concentrating the same general current into a tightly wound solenoid produces a field roughly two orders of magnitude stronger than a single straight wire at a comparable distance.
Reference Field Strengths
| Source | Typical Flux Density |
|---|---|
| Earth's surface magnetic field | 25–65 µT |
| Small refrigerator magnet | ~5 mT |
| Clinical MRI scanner | 1.5–3 T |
1 tesla (T) = 1,000 millitesla (mT) = 1,000,000 microtesla (µT).
Where This Calculation Matters
- Electromagnet and solenoid design — predicting the field a coil will generate before winding it, based on turns, length, and drive current.
- EMI/EMC assessment — estimating stray magnetic fields near high-current conductors, relevant for sensitive nearby electronics.
- Physics and engineering coursework — checking the three classic Ampère's-law geometries against textbook problems.
- Sensor and relay design — many reed switches and Hall-effect sensors are specified against a known trigger flux density.
How to Use This Calculator
- Choose the configuration: Long Straight Wire, Center of Circular Loop, or Inside a Solenoid.
- For a straight wire, enter Current and Distance from Wire.
- For a loop, enter Current and Loop Radius.
- For a solenoid, enter Current, Number of Turns, and Solenoid Length.
- Select Calculate to see the resulting magnetic flux density.
Related Calculations
See the companion field generated by static charge with the Electric Field Calculator, or work backward from field to current with the Ohm's Law Calculator.