Works on this device
Solenoid Magnetic Field Calculator
A solenoid is a coil of wire wound as a long cylinder. A current through it makes a strong, even magnetic field inside. Work out that field from the turns, the length and the current, solve for the current or the turns, or find the field anywhere on the axis of a short coil.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose Calculate.
Your result
How it was worked out
How to use this calculator
- Choose Field inside a long solenoid for the usual formula, or Field on the axis of a finite solenoid for a short coil or a point near the ends.
- Under What do you want to find? choose the field, the current or the turns. Type the other values.
- Give the winding as the number of turns and the length, or as turns per metre, per centimetre or per inch.
- For a coil with a core, open More options and type the relative permeability of the core. Read the note on cores first.
- Choose Calculate. The answer shows the field in mT (you can change the unit), the field strength H and the working.
The solenoid magnetic field equation
- Long solenoid: B = μ0 × μr × n × I, with n = N ÷ L the number of turns per metre and I the current in amperes. B is in teslas.
- Field strength: H = n × I in amperes per metre. It does not depend on the core.
- Short (finite) solenoid on its axis: B(z) = (μ0 N I ÷ 2L) × ((z + L/2) ÷ √(R² + (z + L/2)²) − (z − L/2) ÷ √(R² + (z − L/2)²)), with z measured from the centre and R the radius of the winding.
- At the centre of a short coil this is μ0 N I ÷ √(L² + D²); at each end it is μ0 N I ÷ (2 √(L² + R²)), about half the centre value for a long coil.
- Direction (right-hand rule): curl the fingers of your right hand the way the current flows round the coil. The thumb points along the field inside, towards the north end.
- μ0 is the magnetic constant, 1.25663706127 × 10^-6 T·m/A (CODATA 2022). Since 2019 it is measured and no longer exactly 4π × 10^-7 T·m/A.
Worked examples
Long solenoid. 500 turns wound over 25 cm give n = 500 ÷ 0.25 = 2,000 turns per metre. With 2.0 A, B = 1.25663706 × 10^-6 × 2,000 × 2.0 = 0.0050265 T, about 5.0 mT. H = 2,000 × 2.0 = 4,000 A/m.
Current for a field. For 10 mT with 2,000 turns per metre the coil needs I = 0.010 ÷ (1.25663706 × 10^-6 × 2,000) = 3.98 A.
Turns for a field. For 5.0 mT in a coil 25 cm long at 2.0 A: N = B L ÷ (μ0 I) = 497.4, so wind 498 turns.
Short coil. 200 turns, 10 cm long and 4.0 cm across, with 1.5 A. The long-solenoid formula gives 3.770 mT. The finite formula gives 3.500 mT at the centre (0.928 of it) and 1.848 mT at each end.
Limits you should know
- The long-solenoid formula holds inside a coil that is much longer than it is wide (10 times or more), away from the ends. For a short coil use the finite solenoid mode.
- The winding is taken as one thin, even layer. Several layers, thick wire or spaced turns change the field a little.
- A core multiplies the field by μr only when it fills a very long coil (or closes on itself) and stays below saturation. A short iron rod in a coil raises the field much less, because of its own ends. No core data is built in.
- Off the axis of a short coil the field is not worked out.
- Answers are shown to the significant figures of your least precise input. A permeability of exactly 1 (air) counts as exact.
- For the field of a wire, one loop, a Helmholtz pair or a toroid see the Magnetic Field Calculator. For the inductance and pull force of a solenoid see the Inductance Solenoid Calculator. For the flux through the coil see the Magnetic Flux Calculator.