Magnetic Field of a Long Straight Wire Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

Introduction: The Physics of Magnetic Fields Around Wires

Whenever electric charges move, they generate magnetic fields. A simple yet fundamental example is an infinitely long, straight conductor carrying a steady current. In this configuration, the magnetic field lines form concentric circles centered on the wire, and their strength diminishes with distance. This calculator applies the formula derived from Ampère's law or the Biot–Savart law to compute the magnitude of the magnetic field at a given radial distance. The relationship is expressed as B = μ 0 I 2 π r , where μ 0 is the permeability of free space, I is the current in amperes, and r is the perpendicular distance from the wire in meters. Understanding this simple geometry lays the groundwork for analyzing more intricate electromagnetic systems ranging from coils to transmission lines.

Derivation from Ampère's Law

Ampère's circuital law states that the line integral of the magnetic field around a closed loop equals the permeability times the total current enclosed: B · dℓ = μ 0 I . For a straight wire, the symmetry suggests choosing a circular integration path of radius r centered on the wire. The magnetic field has constant magnitude and is tangent to the circle, reducing the integral to B · 2 π r = μ 0 I . Solving for B yields B = μ 0 I 2 π r . This derivation highlights the inverse relationship between field strength and distance: doubling the distance halves the field.

Visualization of Field Lines

Magnetic fields around a wire can be visualized using the right-hand rule. Point the thumb of the right hand in the direction of the current, and the curled fingers indicate the direction of circular field lines. Nearby iron filings or compasses reveal these patterns experimentally. Field strength diminishes with distance, so compasses placed farther away deflect less. This behavior contrasts electric fields, which radiate outward rather than circling the source.

Formula: Sample Calculations

The table below gives sample magnetic field strengths for a wire carrying a current of 5 A at various distances. The permeability of free space μ 0 equals 4 π × 10 - 7 T·m/A. As distance increases, the field drops off rapidly.

Distance r (m) B (µT)
0.01 100
0.05 20
0.10 10
0.50 2
1.00 1

Why the 1/r Field Matters in Real Hardware

That simple 1/r falloff shows up any time you have to reason about a wire's magnetic footprint. Run this calculator for a single 15 A conductor and you get about 300 µT at 1 cm, but it falls below Earth's field of roughly 50 µT once you back off past 6 cm. In real house wiring the hot and neutral run side by side carrying opposite currents, so their fields largely cancel and a magnetometer a hand's width away sees almost nothing — the isolated-wire number is a worst case, not what a cable actually radiates. The same math explains why a Hall probe or gaussmeter has to be zeroed and mapped against a known current before you trust its reading: the reference field it uses is a straight wire at a measured distance, and a millimeter of positioning error changes B by several percent. Twisted-pair Ethernet leans on the opposite trick. Two conductors carrying equal and opposite currents produce nearly cancelling fields, and twisting them averages out whatever residual coupling remains, which is how a cable survives running alongside a noisy power line. Push the current far higher and the field stops being a nuisance and becomes the working principle: motor windings, MRI gradient coils, and accelerator steering magnets all exist to put a controlled B where they need it.

Relation to the Biot–Savart Law

While Ampère's law provides an elegant route for symmetric situations, the Biot–Savart law offers a more general solution for the magnetic field from any current distribution. It states B = μ 0 4 π I dℓ × r r 3 . For an infinitely long straight wire, the integration reproduces the familiar B = μ 0 I 2 π r . The Biot–Savart perspective becomes essential when dealing with finite wires, loops, or coils where symmetry is less pronounced.

Units and Measurement

The magnetic field is measured in teslas (T), named after Nikola Tesla. One tesla is a substantial field; everyday environments typically have fields in the microtesla range. Earth's magnetic field near the surface ranges from about 25 to 65 µT. The formula implemented here returns B in teslas, but the result display converts to microteslas for convenience because the magnitudes near laboratory wires often fall in that range.

Safety Considerations

High currents can produce strong magnetic fields and significant heating. When working with large currents, ensure proper insulation and consider the mechanical forces that arise between parallel wires carrying current in the same or opposite directions. Attractive or repulsive forces can be substantial in power systems, leading to mechanical stress. Although the magnetic fields from household currents are generally weak, specialized facilities with high-current experiments must account for potential hazards.

Walking Through a 50 A Wire at 2 cm

Suppose a straight wire carries 50 A and we wish to know the magnetic field 2 cm away. Plugging values into the formula gives B = 4 π × 10 - 7 × 50 2 π × 0.02 T, which simplifies to approximately 5 × 10 - 4 T or 500 µT. Such a field is several times stronger than Earth's field and could noticeably deflect a compass needle. Doubling the distance to 4 cm would halve the field to 250 µT.

Multiple Wires and Superposition

If several wires carry currents, the net magnetic field at a point is the vector sum of the individual fields. For parallel wires with currents in the same direction, fields between the wires oppose each other, leading to reduced magnitude midway. With opposite currents, the fields reinforce between the wires. Such effects underpin the operation of transmission lines and transformers, where careful arrangement of conductors minimizes unwanted fields and maximizes efficiency.

Limitations of the Model

The ideal formula assumes an infinitely long wire in a uniform, non-magnetic medium. Real wires have finite length and may be near materials with magnetic properties, altering the field distribution. Close to the wire, the assumption of uniform current density may break down if skin effects occur at high frequencies. Additionally, extremely high currents can produce fields strong enough to require relativistic corrections. Despite these limitations, the simple model offers excellent accuracy for a wide range of practical scenarios.

Historical Perspective

The relationship between electric currents and magnetism was first observed by Hans Christian Ørsted in 1820 when he noticed a compass needle deflecting near a current-carrying wire. This discovery sparked rapid developments by Ampère, Faraday, and others, leading to the unification of electricity and magnetism. Maxwell later synthesized these ideas into his famous equations, of which Ampère's law is one component. The ability to calculate magnetic fields from currents revolutionized technology, enabling telegraphs, electric motors, and modern power grids.

How to use: Using the Calculator

Enter the current in amperes and the perpendicular distance from the wire in meters. The calculator assumes the standard permeability of free space and computes the magnetic field magnitude. Results appear in microteslas for convenience. Experiment with different values to see how doubling the current doubles the field, while doubling the distance halves it. Such exploration reinforces the intuitive relationships between current, distance, and field strength.

Two Numbers That Are Worth Memorizing

If you take nothing else from this page, keep two anchors in mind. First, a 1 A current at 1 m gives 0.2 µT — a tiny field, and every other case scales linearly from it: multiply the current, divide by the distance in meters, and you have your answer without touching a calculator. Second, the field circles the wire and dies off as 1/r, so getting twice as far away buys you half the field, not a quarter. Once those two facts are second nature, this tool becomes a way to check your arithmetic rather than a black box, and the readings it returns for lab wiring, transmission spans, or a coil you are winding will match your intuition instead of surprising you.

Arcade Mini-Game: Magnetic Field of a Long Straight Wire Calculator Calibration Run

Use this quick arcade run to practice separating useful scenario inputs from common planning mistakes before you rely on the calculator output.

Score: 0 Timer: 30s Best: 0

Start the game, then use your pointer or arrow keys to catch useful inputs and avoid bad assumptions.

Enter current and distance to compute magnetic field strength.