Advertisement
Advertisement
PHYSICS

Magnetic Field of a Wire Calculator — B at a distance from a conductor

Work out the magnetic flux density around a long straight current-carrying wire, or the distance at which the field falls to a value you specify.

Leave the relative permeability at 1 for air, vacuum, water, plastic and every non-magnetic metal including copper and aluminium. It only differs meaningfully inside iron and other ferromagnetic material.
Uses the same distance unit. Set to zero to ignore. When set, the tool reports the force per metre between the two conductors carrying the same current.
Magnetic flux density
 
 
0
Field in microtesla
0
Field in gauss
0
Distance used
0
Force per metre on a parallel wire
Tip: the field falls as one over the distance, not one over distance squared. Doubling the distance from a wire halves the field, which is a much slower decay than around a point charge or a magnet.
Advertisement

The magnetic field of a wire calculator above gives the magnetic flux density at a chosen distance from a long straight conductor carrying a steady current. It solves in three directions: the field at a distance, the distance at which the field reaches a target value, and the current needed to produce a particular field. It also computes the force per metre between two parallel conductors, which is the relation that historically defined the ampere.

Arb Digital builds free calculators that each own one job. The neighbouring tool on this site is the magnetic field converter, and the boundary is clean: that page rescales a field you already have between tesla, gauss, amperes per metre and weber, while this page produces the field in the first place from a current and a distance. Once you have a field value, the Lorentz force calculator takes it and returns the force on a charge moving through it.

What This Magnetic Field Calculator Does

A steady current in a straight wire produces a magnetic field whose lines are circles centred on the wire and lying in planes perpendicular to it. The field has no component along the wire and no component pointing toward or away from it — it wraps around, and its direction follows the right-hand rule: point the thumb of your right hand along the conventional current and your fingers curl the way the field does.

The magnitude depends on only two things: how much current is flowing and how far away you are. It does not depend on the wire's thickness, its material, or the voltage driving the current, provided you are outside the conductor. A thin wire and a thick busbar carrying the same ten amperes produce the same field at the same distance from their centres.

The tool works in microtesla by default because that is the scale of most everyday situations. Ten amperes at five centimetres gives forty microtesla, which happens to be roughly the strength of the Earth's own magnetic field at the surface — a useful anchor for how modest these fields are compared with a permanent magnet, which is measured in hundreds of millitesla.

How to Use It

  1. Enter the current in amperes. For alternating current, this relation gives the instantaneous field for an instantaneous current, so use an RMS value to get an RMS field.
  2. Enter the distance from the centre of the wire. The formula is measured from the axis, not from the surface of the insulation, which matters when you are very close to a thick conductor.
  3. Choose the direction you are solving in. Solving for distance answers the practical question of how far away a field falls below some threshold.
  4. Leave the relative permeability at 1 unless the wire runs through iron or another ferromagnetic material, which is uncommon and changes the answer by orders of magnitude when it happens.
  5. Add a second wire if you want the force. Two parallel conductors carrying current in the same direction attract; in opposite directions they repel.

The Formula: How the Field Around a Wire Is Calculated

For an infinitely long straight wire, the magnetic flux density at a perpendicular distance R is B = μ0I ÷ (2πR). OpenStax University Physics Volume 2, section 12.2 on the magnetic field due to a thin straight wire, derives this result from the Biot-Savart law and states that the field lines of the infinite wire are circular and centred on the wire, with a magnitude that falls in proportion to the distance from it.

The constant μ0 is the vacuum magnetic permeability. The NIST CODATA fundamental constants database gives its 2022 recommended value as 1.25663706127 × 10−6 N A−2, with a standard uncertainty in the eleventh digit. Since the 2019 redefinition of the SI base units it is a measured quantity rather than an exactly defined one, though the difference from the old exact value of 4π × 10−7 is far below anything that matters here.

The force per unit length between two long parallel wires separated by distance d and carrying currents I1 and I2 is F/L = μ0I1I2 ÷ (2πd). This follows directly from the field of one wire acting on the current in the other, and it is the relation that defined the ampere before 2019.

Work the defaults as a check. Ten amperes at five centimetres, in air. B = (1.2566371 × 10−6 × 10) ÷ (2π × 0.05) = 1.2566371 × 10−5 ÷ 0.31416 = 4.0 × 10−5 T, which is 40 microtesla or 0.4 gauss.

Advertisement

Why the Field Falls as 1/r Rather Than 1/r²

Almost every other field people meet — gravity, the electric field of a point charge, sound intensity, light from a bulb — falls off as the inverse square of distance. A wire does not, and the reason is geometric rather than mysterious. An inverse-square law arises when something spreads out over the surface of a sphere, whose area grows as the square of the radius. A long wire is not a point, and the field around it spreads over the surface of a cylinder instead, whose area grows only in proportion to the radius.

The practical consequence is that fields from wiring reach further than intuition suggests. Moving from 10 cm to 1 m from a cable reduces the field by a factor of ten, not a hundred. That is why cabling in sensitive instrumentation is treated as a layout problem across a whole enclosure rather than a matter of keeping a small clearance. The site's inverse square law calculator covers the genuinely inverse-square case for comparison.

The 1/r behaviour also has a limit that is easy to miss. It only holds while the wire looks long compared with your distance from it. Get far enough away that the wire's finite length becomes visible and the field starts to fall faster, eventually approaching inverse-square behaviour as the whole circuit shrinks to a point. As a rough guide, treat the formula as reliable while the distance is well under a tenth of the wire's length.

Why Real Cables Produce Far Less Field Than This

This is the most important practical caveat on the page, and it is the reason a measurement near a household cable comes out far below what the formula predicts. Current has to return. A single isolated wire carrying a steady current in one direction cannot exist as a complete circuit, so any real installation has a return conductor somewhere, and it carries the same current the other way.

Two conductors close together with opposite currents produce fields that very nearly cancel. What remains falls off much faster than 1/r — closer to 1/r² once you are further away than the spacing between them — because at a distance the pair increasingly looks like nothing at all. A twisted pair takes this further by swapping the two conductors' positions repeatedly, cancelling what is left over each half twist.

So the single-wire formula gives you an upper bound rather than a prediction for ordinary wiring. It is the right calculation for a busbar whose return path is far away, for a single core in a separated arrangement, or for the field very close to one conductor where the return is comparatively distant. It substantially overstates the field around a two-core flex or a twisted pair. The site's wire size calculator and voltage drop calculator deal with the current-carrying side of real cables.

Inside the Conductor, and the Coil Case

The formula applies outside the wire. Inside a solid conductor with uniformly distributed current, the field behaves in the opposite way: it is zero at the exact centre and rises linearly to the surface, because only the current enclosed within your radius contributes. The maximum field anywhere is therefore at the surface of the conductor, and the tool warns you when the distance you have entered is small enough that this distinction is likely to matter.

The other thing to be clear about is that a coil is a completely different problem. Wrapping the same wire into a solenoid stacks the contributions of every turn, and inside a long solenoid the field is roughly uniform and proportional to the number of turns per metre rather than to one over a distance. A hundred-turn coil produces a far stronger internal field than a single straight wire with the same current, which is exactly why electromagnets are wound rather than stretched out.

Alternating current adds a further wrinkle at higher frequencies. The skin effect pushes current toward the outside of the conductor, which changes the field distribution inside the metal, though outside the wire the total enclosed current is all that matters and the external field is unaffected. The Faraday's law calculator covers what a changing field induces in a nearby circuit, which is usually the reason anyone cares about this in the first place.

Need a website that loads fast and actually works?

Arb Digital builds free tools like this one because useful pages earn attention. If you want tools, calculators or content built for your own audience, we can help.

Browse All Free Tools Talk to Arb Digital

Common Mistakes to Avoid

  • Measuring from the insulation rather than the axis — the distance in the formula runs to the centre of the conductor, which matters most when you are close to a thick one.
  • Applying it to a two-core cable — the return conductor cancels most of the field, so the single-wire answer is an upper bound rather than a prediction.
  • Assuming inverse-square falloff — the field around a wire falls as one over the distance, so it reaches considerably further than a point source would.
  • Using it inside the conductor — within a solid wire the field rises from zero at the centre to a maximum at the surface, the opposite of the external behaviour.
  • Using it for a coil — a solenoid stacks the contribution of every turn and follows an entirely different relation based on turns per metre.

Related Free Tools From Arb Digital

Convert a field between tesla, gauss and amperes per metre with the magnetic field converter, and find the force it exerts on a moving charge with the Lorentz force calculator. The Faraday's law calculator covers induced voltage from a changing field, and the inverse square law calculator handles the genuinely inverse-square sources this one is often confused with. For the current-carrying conductor itself, see the wire size calculator, the voltage drop calculator and the Ohm's law calculator. Everything is indexed on the free online tools hub.

Frequently Asked Questions

What is the formula for the magnetic field around a wire?

B equals the vacuum permeability times the current, divided by two pi times the distance from the wire's axis. For 10 amperes at 5 centimetres in air that gives 40 microtesla, which is about the strength of the Earth's own field.

Why does the field fall as 1/r instead of 1/r squared?

Because the field spreads over the surface of a cylinder rather than a sphere, and a cylinder's area grows in proportion to its radius rather than the square of it. Doubling your distance therefore halves the field instead of quartering it.

Does the thickness or material of the wire matter?

Not for the field outside it. Only the total current enclosed and your distance from the axis matter, so a thin wire and a thick busbar carrying the same current produce the same external field at the same distance from centre.

Why is the field near a household cable much lower than this predicts?

Because a real cable contains a return conductor carrying the same current the other way, and the two fields largely cancel. The single-wire formula is an upper bound; a twisted pair cancels even more thoroughly.

What is the field inside the wire itself?

It rises from zero at the exact centre to a maximum at the surface, because only the current enclosed within your radius contributes. That is the opposite of the external behaviour, where the field falls as you move away.

Can I use this for a coil or solenoid?

No. A coil stacks the contributions of every turn, and the field inside a long solenoid is roughly uniform and set by the turns per metre rather than by distance from a single conductor. It needs a different formula entirely.

Do two parallel wires attract or repel?

They attract when the currents flow in the same direction and repel when they flow in opposite directions. The force per metre is the permeability times the product of the currents, divided by two pi times their separation.

Does this work for alternating current?

It gives the instantaneous field for an instantaneous current, so feeding it an RMS current returns an RMS field. At high frequencies the skin effect changes the current distribution inside the metal, but the external field still depends only on the total enclosed current.

This tool is provided for educational and estimating use. It models an infinitely long, straight, isolated conductor in a uniform non-magnetic medium, and real installations depart from that in ways that usually reduce the field substantially. It is not an exposure assessment, a compliance measurement or a design tool, and any question about electromagnetic field exposure limits or about work on electrical installations should go to a qualified professional.

Advertisement
Advertisement

Take it further