Magnetic field calculator (wire, loop, solenoid and toroid)
Enter your values. The answer and the full worked solution update as you type.
Result
Calculate the magnetic flux density B produced by a current: around a long straight wire, at the centre of a circular loop or coil, inside a long solenoid and inside a toroid, with an optional iron core. A fifth mode gives the force on a wire carrying a current in a magnetic field. Results are in tesla and gauss and are compared with the Earth’s magnetic field.
Step-by-step solution
Permeability of free space
Inside a long solenoid
Key formulas
- Long straight wire
- B = μ0I/(2πr)
- Centre of a flat coil
- B = μ0NI/(2R)
- Long solenoid
- B = μ0nI, n = N/L
- Constant
- μ0 = 4π × 10⁻⁷ T·m/A
- Force on a wire
- F = BIL·sin θ
- Force on a charge
- F = |q|vB·sin θ
- Circular motion
- r = mv/(|q|B), T = 2πm/(|q|B)
- Parallel wires
- F/L = μ0I1I2/(2πd)
- Flux
- Φ = BA·cos θ
- Faraday’s law
- ε = −N·ΔΦ/Δt
- Moving rod
- ε = BLv
- Generator
- E0 = NBAω, Erms = E0/√2
- Inductance
- ε = L·ΔI/Δt, L = μ0N²A/l, W = ½LI²
- Mutual inductance
- ε2 = M·di1/dt, M = k√(L1L2)
- Velocity selector and spectrometer
- v = E/B, r = √(2mV/|q|)/B
How to calculate the magnetic field of a current
- Use the permeability of free space μ₀ = 4π × 10⁻⁷ T·m/A and convert all lengths to metres.
- Long straight wire: B = μ₀·I/(2π·r) at a distance r. The field lines are circles around the wire (right-hand grip rule).
- Centre of a circular loop with N turns: B = μ₀·N·I/(2R).
- Long solenoid: B = μ₀·μr·n·I with n = N/L turns per metre; the field inside is nearly uniform. Toroid: B = μ₀·μr·N·I/(2π·r).
- Force on a straight wire in a field: F = B·I·L·sin θ, where θ is the angle between the wire and the field.
Questions and answers
What is the difference between tesla and gauss?
Both measure magnetic flux density. The tesla is the SI unit and 1 T = 10 000 gauss. The Earth’s field is about 50 µT, or 0.5 G; a fridge magnet is around 5 mT and an MRI scanner 1.5 to 3 T.
Why does an iron core increase the field?
Iron has a large relative permeability μr, often several thousand, so it multiplies the field. But iron saturates at about 1.5 to 2 T, so beyond that the simple formula overestimates the field.
How accurate is the solenoid formula?
It is exact for an infinitely long solenoid. For a real coil it is good near the middle when the length is much larger than the radius; at the ends the field falls to about half.
Which direction does the force on a wire act?
Perpendicular to both the wire and the field, given by the right-hand rule (or Fleming’s left-hand rule). It is largest when the wire is perpendicular to the field and zero when it runs along the field.
Practise it yourself
Practise Magnetic fields & induction
A calculator gives the answer. In the exam you need the method: practise it with new problems, hints and worked solutions.