Magnetic Field of Straight Wire Calculator

Calculate the magnetic field around a current-carrying wire using the Biot-Savart law. Supports infinite and finite wire models with permeability.

About the Magnetic Field of Straight Wire Calculator

A straight current-carrying wire produces a magnetic field that circles around it in concentric rings, with the field strength decreasing inversely with distance. This is one of the most fundamental relationships in electromagnetism, described by Ampere's law and the Biot-Savart law. The famous formula B = µ₀I/(2πr) appears in every physics textbook and is the starting point for understanding electromagnets, transformers, motors, and power transmission.

For an infinitely long wire, the field depends only on the current and the perpendicular distance from the wire. For real wires of finite length, a correction factor accounts for the reduced contribution from the wire ends. This calculator handles both cases, letting you compare the ideal infinite-wire result with the more realistic finite-wire field.

Beyond the basic field calculation, this calculator also computes the force between parallel wires (the basis for the original definition of the ampere), the magnetic flux through nearby surfaces, and a comparison with Earth's magnetic field. The material permeability input lets you explore how ferromagnetic cores amplify the field by factors of thousands.

Why Use This Magnetic Field of Straight Wire Calculator?

Understanding the magnetic field around current-carrying conductors is essential for electrical safety (magnetic field exposure limits), EMI/EMC design (shielding and separation distances), sensor placement, and electromagnetic device design. This calculator provides instant field values for any current and distance combination.

The side-by-side infinite vs finite wire comparison helps you understand when the textbook formula is accurate and when end effects matter. The permeability input extends the calculator to real materials, showing the dramatic field amplification possible with ferromagnetic cores.

How to Use This Calculator

  1. Select a preset scenario or enter custom values.
  2. Enter the current flowing through the wire in amperes.
  3. Enter the perpendicular distance from the wire and select the unit.
  4. Enter the wire length for the finite-wire correction.
  5. Optionally change the relative permeability for non-vacuum environments.
  6. Read the magnetic field for both infinite and finite wire models.
  7. Check the distance table to see how the field varies with distance.

Formula

Magnetic Field of a Straight Wire: • Infinite wire (Ampere's law): B = µ₀µᵣI / (2πr) • Finite wire (Biot-Savart): B = (µ₀µᵣI / 4πr)(sin θ₁ + sin θ₂) • Force between parallel wires: F/L = µ₀I₁I₂ / (2πd) • Direction: right-hand rule (thumb = current, fingers = field) Where µ₀ = 4π × 10⁻⁷ T·m/A, µᵣ = relative permeability, I = current (A), r = distance (m)

Example Calculation

Result: B = 300.0 µT (infinite wire), 299.9 µT (1 m finite wire)

A 15A household wire produces B = (4π × 10⁻⁷ × 15) / (2π × 0.01) = 300 µT at 1 cm distance — about 6× Earth's field. The finite wire result is nearly identical because 1 m is much longer than the 1 cm observation distance.

Tips & Best Practices

Ampere's Law and the Biot-Savart Law

The magnetic field around a straight wire can be derived from two complementary laws. Ampere's law states that the line integral of B around any closed path equals µ₀ times the enclosed current. For the symmetric case of an infinite straight wire, choosing a circular Amperian loop gives B × 2πr = µ₀I immediately.

The Biot-Savart law is more general and gives the field contribution dB from each current element: dB = (µ₀/4π) × (I dl × r̂)/r². Integrating along a finite wire of length L gives the finite-wire formula involving the angles subtended by the wire ends. As L → ∞, the angles approach 90° and the result reduces to the Ampere formula.

Practical Applications

Power line engineers use the wire field formula to calculate magnetic field exposure for workers and nearby residents. High-voltage transmission lines carrying hundreds of amperes produce measurable fields at ground level. Shield wires, optimal conductor spacing, and phase arrangement are designed to minimize these fields.

In circuit board design, trace current creates magnetic fields that can couple to adjacent traces (crosstalk). The 1/r dependence means that doubling the trace spacing cuts the coupling by half. Ground planes provide return current paths that minimize the loop area and reduce radiated emissions.

Superposition and Multiple Wires

When multiple wires are present, the total field is the vector sum of individual wire fields. For a coaxial cable, the equal and opposite currents on the inner conductor and shield produce zero net field outside the cable. For parallel wires carrying current in the same direction, the fields between them oppose each other, while a two-wire power cord's opposing currents produce a dipole field that falls off rapidly with distance.

Frequently Asked Questions

Why does the field decrease as 1/r?

By symmetry, the magnetic field has cylindrical symmetry around a long straight wire. Applying Ampere's law to a circular path of radius r gives B × 2πr = µ₀I, so B = µ₀I/(2πr). The 1/r dependence reflects the spreading of the field over a larger circumference at greater distances.

When should I use the finite wire formula?

Use the finite wire formula when the observation distance is comparable to or larger than the wire length. As a rule of thumb, if r > L/10, the finite correction becomes significant (>5% difference). For r < L/100, the infinite wire model is essentially exact.

What is the right-hand rule for a wire?

Point your right thumb in the direction of conventional current (positive to negative). Your fingers curl in the direction of the magnetic field. Current flowing upward produces counterclockwise field when viewed from above.

How was the ampere originally defined?

The ampere was originally defined as the constant current that, flowing in two infinite parallel wires 1 meter apart, produces a force of 2 × 10⁻⁷ N per meter of length. This is exactly the force formula F/L = µ₀I²/(2πr) with I = 1A and r = 1m.

Is the field dangerous near household wiring?

At typical distances (a few centimeters), household wiring at 15A produces fields of 100-300 µT. This is above Earth's field but well below levels considered hazardous in occupational guidelines (typically 500 µT to 1 mT for extended exposure).

How does permeability affect the field?

Wrapping the wire around a ferromagnetic core (iron, ferrite) multiplies the field by the relative permeability µᵣ. Silicon steel has µᵣ ≈ 5000-10000, meaning the field is thousands of times stronger inside the core than in air — this is the principle behind electromagnets and transformers.

Related Pages