Skip to content

Magnetic Field Calculator

Magnetic field of a straight wire, a coil or a solenoid, and the magnetic force on a wire, between two parallel wires or on a moving charge (Lorentz force).

Calculator Details

Field at that distance:4 × 10⁻⁵ TSee results ↓

The field of a wire, coil or solenoid, or the magnetic force on a wire, between two wires or on a moving charge

Current in amperes

m, cm or mm for distances, radius and lengths

Perpendicular distance from the centre of the wire, or the gap between two parallel wires

Your Results

Field at that distance: 4 × 10⁻⁵ T

Field at that distance

4 × 10⁻⁵ T

40 µT

In microtesla

40 µT

0.8 × the Earth’s typical field

In gauss

0.4 G

1 G = 10⁻⁴ T

The wire’s field at that distance is 40 µT, about 0.8 times the Earth’s field.

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Field against distance from the wire

Field against distance from the wire

Detailed Breakdown

Results
QuantityValue
Magnetic field B4 × 10⁻⁵ T = 40 µT
Compared with the Earth’s field (≈ 50 µT)0.8 ×
B at 1 cm200 µT
B at 5 cm40 µT
B at 9 cm22.2222 µT
B at 13 cm15.3846 µT
B at 17 cm11.7647 µT

How This Calculator Works

How It’s Calculated

Wire: B = μ₀I ÷ 2πr · Coil centre: B = μ₀NI ÷ 2R · Solenoid: B = μ₀μᵣnI
Force on a wire: F = BIL sin θ · Parallel wires: F/L = μ₀I₁I₂ ÷ 2πd
Moving charge: F = |q|vB sin θ, r = mv ÷ |q|B, T = 2πm ÷ |q|B

Your calculation: B = μ₀I ÷ (2πr) = 1.2566 × 10⁻⁶ × 10 ÷ (2π × 5 cm) = 4 × 10⁻⁵ T.

μ₀ = 1.25663706127 × 10⁻⁶ N/A² (CODATA 2022). The Earth’s field is roughly 25 to 65 µT depending on where you are; about 50 µT is used for the comparison.

Frequently Asked Questions

How strong is the magnetic field around a wire?

B = μ₀I ÷ (2πr): it grows with the current and falls with distance. A wire carrying 10 A produces 40 µT at 5 cm, 0.8 times the Earth’s field. A 15 A appliance cord is a special case: its two conductors carry opposite currents, so their fields mostly cancel a few centimetres away (one conductor alone would give 300 µT at 1 cm).

What is the Earth’s magnetic field strength?

Between about 25 and 65 microtesla at the surface (NOAA), weakest near the magnetic equator and strongest near the magnetic poles. Southern Canada is around 50 µT, and the field there points steeply downward.

How do I calculate the field inside a solenoid?

For a long solenoid B = μ₀μᵣnI, where n is the number of turns per metre. 100 turns over 20 cm with 10 A gives 0.00628 T in the ideal formula; because this coil is short and fat (R = 5 cm), the field at its centre is lower, 0.00562 T, from B = μ₀μᵣNI ÷ √(L² + 4R²).

Why does an iron core make an electromagnet stronger?

Iron’s magnetic domains line up with the coil’s field and add to it, multiplying the field by the relative permeability μᵣ, which can be hundreds or thousands. The effect stops at saturation, around 1.5 to 2 T for soft iron, so the formula overestimates strong electromagnets. The calculator applies μᵣ to the solenoid only.

Do two parallel wires attract or repel?

Currents in the same direction attract and opposite currents repel, with a force per metre of μ₀I₁I₂ ÷ (2πd). Two wires 1 m apart each carrying 1 A push or pull with 2.000e-7 N per metre, which is how the ampere was defined until 2019.

What is the Lorentz force?

The force on a charged particle moving through electric and magnetic fields, F = q(E + v × B). The magnetic part, |q|vB sin θ, is always at right angles to the velocity, so it bends the path into a circle without changing the speed. A proton at 1,000 km/s across a 0.5 T field feels 8.011e-14 N and circles with a radius of 0.0209 m. The calculator covers the magnetic part; add qE separately if there is an electric field.

What is the right-hand rule?

For a wire, point your right thumb along the current: your fingers curl in the direction of the field circles around it. For a force, point your fingers along v (or the current) and curl them toward B: your thumb gives the force on a positive charge. For a negative charge such as an electron, the force is the opposite way.

What is the difference between tesla and gauss?

Both measure magnetic flux density. The tesla is the SI unit; the gauss is the older CGS unit, and 1 T = 10,000 G. A fridge magnet is about 5 mT (50 G), an MRI scanner 1.5 to 3 T, and the Earth’s field about half a gauss.

Uses the magnetostatics formulas of OpenStax University Physics Vol. 2 ch. 11–12 with μ₀ and particle masses from CODATA 2022. Wires are infinitely long and thin, coils are ideal circles, the solenoid field is the value on its axis at the centre, and the Earth comparison uses a round 50 µT. It leaves out the field off the axis of a coil, iron saturation and hysteresis, the electric part of the Lorentz force (qE), relativistic speeds, wires of finite length and alternating currents. It is not a guide to safe exposure levels.

Magnetic Field Calculator: Wires, Coils, Solenoids and the Lorentz Force

By FindMySum · Last reviewed

Every electric current makes a magnetic field, and every magnetic field pushes on moving charges. This magnetic field calculator covers both halves of that story with the standard formulas from introductory physics. It finds the field around a long straight wire, at the centre of a circular coil and inside a solenoid, and the force a field exerts on a current-carrying wire, between two parallel wires and on a moving charged particle such as an electron, proton or alpha particle. Each field result is compared with the Earth's own field so you can tell whether it is tiny or enormous.

Fields from currents

A long straight wire. The field lines form circles around the wire, and their strength falls with distance:

  • B = μ₀I ÷ (2πr)

Here μ₀ is the magnetic permeability of free space, about 1.2566 × 10⁻⁶ N/A², I the current and r the perpendicular distance. The calculator's default, 10 A at 5 cm, gives 4.0 × 10⁻⁵ T or 40 µT, a little less than the Earth's field in southern Canada. Doubling the distance halves the field.

A circular coil. At the centre of a coil of N turns and radius R, the contributions from every part of the wire point the same way and add up:

  • B = μ₀NI ÷ (2R)

A 100-turn coil of radius 5 cm carrying 10 A gives 0.0126 T, about 250 times the Earth's field. Along the coil's axis the field falls off, and the chart shows how.

A solenoid. Wind the wire into a long helix and the field inside becomes nearly uniform:

  • B = μ₀μᵣnI, with n = N ÷ L turns per metre

That formula assumes an infinitely long solenoid. For a real one of length L and radius R, the field at the centre is μ₀μᵣNI ÷ √(L² + 4R²), which the calculator uses as its main result. For 100 turns over 20 cm with a 5 cm radius and 10 A, the ideal formula gives 6.28 mT and the finite-length one 5.62 mT. The longer and thinner the coil, the closer they get. An iron core multiplies the field by its relative permeability μᵣ, up to the point where the iron saturates.

Forces from fields

A wire in a field. A straight wire of length L carrying current I across a field B feels

  • F = BIL sin θ

where θ is the angle between the wire and the field. The force is largest when they are perpendicular and zero when they are parallel. This is the principle of every electric motor and loudspeaker. A 20 cm wire with 10 A at 30° to a 0.5 T field feels exactly 0.5 N.

Two parallel wires. Each wire sits in the other's field, so they push or pull on each other with a force per metre of

  • F/L = μ₀I₁I₂ ÷ (2πd)

Currents in the same direction attract; opposite currents repel. For 1 A in each wire, 1 m apart, the force is 2 × 10⁻⁷ N per metre. That was the official definition of the ampere from 1948 until 2019.

A moving charge. A particle of charge q moving at speed v through a field B feels the magnetic part of the Lorentz force:

  • F = |q|vB sin θ

Because this force is always perpendicular to the velocity, it bends the path into a circle (or a helix if the velocity has a part along the field) of radius r = mv⊥ ÷ (|q|B). The time for one turn, T = 2πm ÷ (|q|B), does not depend on the speed at all; its inverse is the cyclotron frequency.

Worked example: a proton in a magnet

A proton moving at 1,000 km/s straight across a 0.5 T field:

  • F = 1.602 × 10⁻¹⁹ C × 10⁶ m/s × 0.5 T = 8.01 × 10⁻¹⁴ N
  • r = (1.6726 × 10⁻²⁷ kg × 10⁶ m/s) ÷ (1.602 × 10⁻¹⁹ C × 0.5 T) = 0.0209 m, about 2 cm
  • T = 2π × 1.6726 × 10⁻²⁷ ÷ (1.602 × 10⁻¹⁹ × 0.5) = 1.31 × 10⁻⁷ s, a cyclotron frequency of 7.62 MHz

An electron at the same speed would circle 1,836 times faster in a circle 1,836 times smaller, because its mass is that much less. Mass spectrometers use exactly this difference to sort ions by mass.

Directions: the right-hand rules

The calculator gives magnitudes. For directions, use your right hand. For a wire, point your thumb along the current and your fingers curl the way the field circles. For a force on a positive charge or a current, point your fingers along the velocity or current, curl them toward B, and your thumb shows the force. Flip the result for electrons.

How big is a tesla?

The Earth's field is about 25 to 65 µT, depending on location, roughly 50 µT across southern Canada. A fridge magnet is a few millitesla, a hospital MRI scanner 1.5 to 3 T, and the strongest steady laboratory magnets about 45 T. One tesla is 10,000 gauss.

Limits

These are the idealised textbook results: infinitely long thin wires, perfect circular coils, the field on the axis at the centre of a solenoid, iron cores without saturation, and particles well below the speed of light. The calculator leaves out the electric part of the Lorentz force and alternating-current effects. For real magnet design, measure or use finite-element software.

More questions

Can a magnetic field do work on a charged particle?

No. The magnetic force is always perpendicular to the particle's velocity, so it changes the direction of motion but never the speed or kinetic energy. That is why a charge in a uniform field moves in a circle at constant speed. Electric fields do the work in particle accelerators; magnetic fields steer and focus the beam.

Why do power lines not affect compasses much?

Two things. The field of a wire falls off with distance, and transmission lines carry alternating current that reverses 60 times a second in North America, so a compass needle cannot follow it and sees an average of about zero. Directly under a large line, the oscillating field is typically a few microtesla, a fraction of the Earth's steady field.

What happens inside a cyclotron?

Charged particles circle in a strong magnetic field, and an alternating voltage kicks them each half turn. Because the period 2πm ÷ (qB) does not depend on the speed, the kicks stay in step as the particles speed up and spiral outward. Canada's TRIUMF laboratory in Vancouver runs one of the largest cyclotrons in the world.

How does a loudspeaker use the force on a wire?

A coil of wire sits in the gap of a permanent magnet. The music signal sends a changing current through the coil, and the force F = BIL on the wire pushes the coil and the attached cone back and forth, which moves the air. The same force spins electric motors.

What is magnetic permeability?

It measures how easily a material supports a magnetic field. Vacuum has μ₀, about 1.257 × 10⁻⁶ N/A². Most materials, including air, water and copper, have a relative permeability μᵣ very close to 1. Ferromagnetic materials such as iron, nickel and some steels have μᵣ in the hundreds or thousands until they saturate.

Why is μ₀ no longer exactly 4π × 10⁻⁷?

Until 2019 the ampere was defined through the force between two wires, which fixed μ₀ at exactly 4π × 10⁻⁷ N/A². The 2019 SI redefinition fixed the elementary charge instead, so μ₀ became a measured quantity. The CODATA 2022 value differs from 4π × 10⁻⁷ only in the tenth significant figure, far too small to matter here.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy