Magnetic Field of Straight Current-Carrying Wire

Created by Dominik Czernia, PhD candidate
Reviewed by Bogna Szyk
Last updated: Feb 22, 2019

This magnetic field of straight current-carrying wire calculator makes it easy to describe magnetic field produced by a long and straight current-carrying wire. Read on to understand the basics of this phenomena and find out how can you estimate the strength of this field. Make sure to check our electromagnetic force on straight current-carrying wire calculator too!

Magnetic field of a wire

Did you know that electricity is always strictly linked to magnetism? It is the result of one of Maxwell's equations which says that flowing electric current produces a magnetic field. Let us consider the case of a long straight wire which carries an electric current. In this particular situation, magnetic field lines form concentric circles around the cable and the strength of magnetic field depends on the distance from the wire and the current flowing through it.

We can also wind a wire tightly in a thin coil forming solenoid. To learn more about solenoid try our solenoids magnetic field calculator.

How to calculate magnetic field around a wire?

To properly calculate the magnetic field around a wire we would need to make use of cross product and the right hand rule. But we can also approximate. Assuming that our wire is straight and very long, we can estimate a magnetic field around the wire with the following equation:

B = μ0 * I / (2 * π * d)


  • I is the current;
  • d is the distance from the wire;
  • B is the strength of the magnetic field produced at distance d;
  • μ0 is the permeability of free space which have constant value μ0 = 4 * π * 10^(-7) [T * m / A].

You can see that the higher current flowing through the wire and the closer we are to the wire the stronger produced magnetic field is.

Earth's magnetic field

The Earth and the other planets and stars in our universe act like huge magnets. The Earth's magnetic field originates in its core, where very hot electrically conducting fluids are. The motion of these fluids generates a flowing current just like in the wire which is then responsible for producing the magnetic field. The mean magnitude of Earth's magnetic field is changing over the years, but presently it equals about 5 * 10^(-5) T. Although this is a tiny field, we can still see it on the compass.

Let's use our calculator to estimate a current which must flow in a straight wire to obtain Earth's magnetic field at a distance of 1 cm from the wire. It seems after calculations that we need only 2.5 A to keep up with Earth's magnetic field!

Dominik Czernia, PhD candidate
Magnetic field
Check out 77 similar electromagnetism calculators 🧲
Acceleration of a particle in an electric fieldAC wattageBreaker size… 74 more
People also viewed…

Distance attenuation

Distance attenuation calculator finds how the sound level in dB decreases with distance from the sound source.

Grams to cups

The grams to cups calculator converts between cups and grams. You can choose between 20 different popular kitchen ingredients or directly type in the product density.

Magnetic dipole moment

Calculate the magnetic dipole moment of a current-carrying loop or a solenoid with our magnetic dipole moment calculator.


The perfect snowman calculator uses math & science rules to help you design the snowman of your dreams!
Omni Calculator
Copyright by Omni Calculator sp. z o.o.
Privacy policy & cookies
main background