Magnetic Field Calculator

Calculate the magnetic field strength (B) around a current-carrying wire using Ampere's Law. Enter your current and distance values for instant results.

A
m

Quick Facts

Permeability Constant
4pi x 10^-7 T*m/A
mu_0 in vacuum
Earth's Field
25-65 microTesla
Varies by location
MRI Machine
1.5 - 3 Tesla
Medical imaging standard
Unit Conversion
1 T = 10,000 Gauss
Tesla to Gauss

Frequently Asked Questions

What is a magnetic field and how is it created?

A magnetic field is a region around a magnetic material or moving electric charge where magnetic force is exerted. When electric current flows through a wire, it creates a circular magnetic field around the wire. The strength of this field depends on the current magnitude and the distance from the wire. This discovery by Oersted in 1820 unified electricity and magnetism into the field of electromagnetism.

What units are used for magnetic field strength?

Magnetic field strength is measured in Tesla (T) in the SI system. Other common units include Gauss (G), where 1 Tesla = 10,000 Gauss. For very weak fields, microTesla (uT) or milliTesla (mT) are often used. Earth's magnetic field is approximately 25-65 microTesla, while MRI machines operate at 1.5-3 Tesla.

How does distance affect magnetic field strength?

Magnetic field strength decreases inversely with distance from the current source. For a straight wire, doubling the distance halves the field strength (inverse relationship). This is why magnetic fields are strongest close to their source and weaken rapidly as you move away. This 1/r relationship is key to designing electromagnetic devices.

What is the permeability of free space?

The permeability of free space (mu_0) is a physical constant representing how well a vacuum supports magnetic field formation. Its exact value is 4pi x 10^-7 T*m/A (approximately 1.257 x 10^-6 T*m/A). This constant appears in all magnetic field calculations and is fundamental to electromagnetism, relating magnetic field strength to the current that creates it.

How do I determine the direction of a magnetic field?

Use the right-hand rule: point your thumb in the direction of current flow (conventional current, positive to negative), and your curled fingers indicate the direction of the magnetic field lines circling the wire. The field forms concentric circles around the conductor, with the direction determined by current flow direction.

What are practical applications of magnetic field calculations?

Magnetic field calculations are essential in designing electromagnets, electric motors, generators, transformers, MRI machines, magnetic storage devices, particle accelerators, and electromagnetic shielding. Engineers use these calculations to optimize performance, ensure safety compliance, and predict how magnetic fields will interact with their environment.

How accurate is this magnetic field calculator?

This calculator uses the exact Biot-Savart law formula for infinite straight wires, providing theoretical accuracy to many decimal places. Real-world accuracy depends on how well conditions match the ideal model (infinitely long straight wire in vacuum). For practical engineering applications, results are typically accurate within 1-5%.

Can I use this calculator for AC current?

Yes, but with caveats. For AC current, enter the RMS (root mean square) current value to get the RMS magnetic field. The instantaneous field oscillates with the current. For peak values, use peak current. Note that AC creates time-varying fields that can induce currents in nearby conductors - an effect not captured by this static field formula.

What is a magnetic field and how is it measured?
A magnetic field is a region of space where magnetic forces act on moving electric charges, magnetic materials, and current-carrying conductors. It is one component of the electromagnetic force — one of the four fundamental forces of nature. What creates a magnetic field: moving electric charges: any charge in motion creates a magnetic field. Current-carrying wires: electric current (moving electrons) generates a magnetic field around the wire. Permanent magnets: magnetism in permanent magnets arises from the alignment of electron spins in ferromagnetic materials (iron, nickel, cobalt, rare earth metals). Changing electric fields: according to Maxwell's equations (Ampère-Maxwell Law), a changing electric field also produces a magnetic field — this is the basis for electromagnetic waves. Measurement units: SI unit: tesla (T). The tesla is a large unit — most everyday magnetic fields are measured in millitesla (mT) or microtesla (μT). CGS unit: gauss (G). Relationship: 1 T = 10,000 G. Earth's field: ~50 μT = 0.5 gauss. How magnetic fields are measured: Hall effect sensors: most common in electronic devices (smartphones, compasses). When current flows through a conductor in a magnetic field, the Lorentz force deflects electrons sideways, creating a measurable voltage proportional to B. Fluxgate magnetometer: measures Earth-scale fields with high precision; used in navigation and geophysics. SQUID (Superconducting Quantum Interference Device): most sensitive magnetic field detector; measures biological fields (heart, brain). NMR/MRI: uses nuclear spin resonance in high magnetic fields to produce images. The magnetic field B is a vector field — at every point in space, it has both a magnitude (how strong) and a direction (which way the field points). The direction of a magnetic field is defined as the direction a compass needle (north pole) points.
What is the formula for the magnetic field of a wire?
The magnetic field of a long, straight current-carrying wire is one of the most fundamental results in magnetism, derived from the Biot-Savart Law. Formula: B = μ₀I / (2πr). Where: B = magnetic field strength (in tesla, T). μ₀ = permeability of free space = 4π × 10⁻⁷ T·m/A (approximately 1.257 × 10⁻⁶ T·m/A). I = electric current in the wire (in amperes, A). r = perpendicular distance from the wire to the point where you're measuring B (in meters, m). Field shape: the magnetic field of a straight wire forms concentric circular rings around the wire. The direction follows the right-hand rule: curl the fingers of your right hand in the direction of the field circles; your thumb points in the direction of current flow. Example calculation: current = 10 A; distance = 5 cm = 0.05 m. B = (4π × 10⁻⁷ × 10) / (2π × 0.05). B = (4π × 10⁻⁶) / (0.1π). B = 4 × 10⁻⁵ T = 40 μT. This is approximately the strength of Earth's magnetic field. How the field varies with distance: doubling the distance (r → 2r) halves the field (B → B/2). This is an inverse-first-power relationship, not inverse square (unlike the electric field of a point charge). The 1/r falloff means fields from power lines still exist at significant distances. Other geometries: center of a circular loop: B = μ₀I / (2R). Inside a solenoid: B = μ₀nI (uniform). For any complex geometry: apply the Biot-Savart Law: dB = (μ₀/4π)(I dL × r̂)/r².
What is the difference between magnetic field B and magnetic field H?
This distinction confuses many students — both B and H describe magnetic fields, but they measure different aspects of magnetism. B field (magnetic flux density): unit: tesla (T). What it measures: the total magnetic field in a material, including contributions from both free currents and bound currents (magnetization). What "flux density" means: B is related to the number of magnetic field lines passing through a unit area — it's the physically measurable force field. When it matters: B is what exerts forces on moving charges and magnetic materials. B is what you feel and what MRI machines and compasses measure. H field (magnetic field strength / magnetizing field): unit: ampere per meter (A/m). What it measures: the contribution to magnetic field from free currents only (not magnetization). Sometimes called the "auxiliary field" or "magnetizing field." In free space (vacuum): B and H are simply proportional: B = μ₀H. This is where most introductory physics stops. In materials: B = μ₀μ_r H = μ₀(H + M), where: μ_r = relative permeability of the material. M = magnetization (contribution from aligned atomic magnetic dipoles). Key insight: in a material like iron (μ_r ≈ 1,000–10,000), the same H field produces a B field 1,000–10,000× stronger than in air. This is why iron cores are used in transformers, motors, and electromagnets — they amplify B for the same driving current. Practical example: applying H = 1,000 A/m in air: B = μ₀ × 1,000 ≈ 1.26 mT. In iron (μ_r = 5,000): B = 5,000 × 1.26 mT = 6.3 T. Same current, 5,000× stronger field. When to use each: use B when calculating forces on charges and currents (F = qv×B, F = IL×B). Use H when analyzing magnetic circuits, transformer design, or material magnetization (where material boundaries matter). For most physics problems and everyday contexts, B is the field you work with.
How does magnetic field strength decrease with distance?
How magnetic field strength decreases with distance depends on the geometry of the magnetic source — different sources follow different distance laws. Straight wire (1/r): B = μ₀I / (2πr). Field decreases as 1/r — doubling distance halves the field. This is slower than inverse square. Magnetic dipole (permanent magnet or current loop) in the far field: along the axis: B ∝ 1/r³. Perpendicular to axis: B ∝ 1/r³. In general, the field of a magnetic dipole falls off as 1/r³ — much faster than a wire. This is why small magnets lose their influence quickly with distance. Solenoid / electromagnet: inside the solenoid, field is approximately uniform (doesn't depend on r). Outside: drops very steeply, roughly as 1/r³ (dipole behavior). MRI magnets use shielding to contain the field. Point charge magnetic analogy (monopole): 1/r² — but magnetic monopoles don't exist in nature (Gauss's law for magnetism: ∇·B = 0). Key comparison table: wire → 1/r; dipole → 1/r³; the difference matters enormously at large distances. A wire at 10 m has 1/10 of its 1-meter field. A dipole at 10 m has only 1/1000 of its 1-meter field. Practical applications: safety around power lines: uses the 1/r law (long wire). Within a few meters, fields can be hundreds of μT; at 100m, typically <1 μT. Permanent magnets: 1/r³ dropoff explains why a strong magnet at 5cm can't pull metal across a room. Wireless charging and NFC: rely on near-field magnetic coupling that falls off steeply — intentionally designed to only work at very short ranges. Earth's magnetic field: Earth behaves roughly as a magnetic dipole, explaining why field strength varies by latitude and why it would be detectable from space (and by magnetometers far above Earth's surface).

Key Takeaways

  • The magnetic field formula for a straight wire is B = mu_0 * I / (2 * pi * r)
  • Field strength is directly proportional to current and inversely proportional to distance
  • The permeability constant mu_0 = 4pi x 10^-7 T*m/A is fundamental to all calculations
  • Use the right-hand rule to determine field direction around a wire
  • 1 Tesla = 10,000 Gauss - understanding unit conversions is essential for practical applications

What Is a Magnetic Field? Understanding Electromagnetism

Source Magnetic Field Strength Notes
Earth's magnetic field25–65 μT (microtesla)Varies by location; ~50 μT at mid-latitudes
Refrigerator magnet~1–5 mT (millitesla)At surface; drops off rapidly with distance
Loudspeaker magnet~1 T (tesla)Neodymium speakers; permanent magnet types
MRI machine (clinical)1.5–3 TStandard clinical; research MRIs up to 7–11 T
NMR spectrometer (research)14–28 THigh-field NMR for chemistry/biochemistry
Strong electromagnet (research)20–45 TContinuous; Florida Magnet Lab world record: 45.5 T
Pulsed laboratory magnet60–100 TShort-duration pulses only; non-destructive
Magnetar (neutron star)10¹¹ TMost intense known magnetic fields in the universe
Note: The tesla (T) is the SI unit of magnetic flux density (B). 1 T = 10,000 gauss (G) in CGS units. The Earth's magnetic field (~50 μT) is about 30,000× weaker than a typical MRI machine (1.5 T).
Source Formula Variables Notes
Infinite straight wireB = μ₀I / (2πr)I = current (A), r = distance (m)μ₀ = 4π×10⁻⁷ T·m/A (permeability of free space)
Center of circular loopB = μ₀I / (2R)I = current (A), R = radius (m)On axis at center of loop
Solenoid (interior)B = μ₀nIn = turns per meter, I = current (A)Uniform field inside; n = N/L
Biot-Savart Law (differential)dB = (μ₀/4π) × (I dL × r̂) / r²dL = current element, r = distanceGeneral form; integrates along any current path
Force on moving chargeF = qv × Bq = charge (C), v = velocity (m/s)Lorentz force; F perpendicular to both v and B
Force between parallel wiresF/L = μ₀I₁I₂ / (2πd)I₁, I₂ = currents, d = separationAttractive if currents in same direction
Note: These formulas assume ideal geometries and free space (vacuum). Real-world calculations must account for material permeability (μ = μ_r × μ₀, where μ_r is relative permeability). Ferromagnetic materials can have μ_r of 1,000–100,000, dramatically amplifying fields.
Property Magnetic Field (B) Electric Field (E)
SI UnitTesla (T)Volt per meter (V/m) or Newton per coulomb (N/C)
SourceMoving charges (currents)Stationary charges
Force on static chargeNoneF = qE
Force on moving chargeF = qv × B (perpendicular to motion)F = qE (parallel to field)
Field linesForm closed loops (no monopoles)Begin at + charges, end at − charges
Work done on chargeZero (force ⊥ velocity)Can do work (force ∥ displacement)
ShieldingFerromagnetic materials (mu-metal)Conductive materials (Faraday cage)
RelationshipRelated via ∂B/∂t = −∇×E (Faraday's Law)Related via ∂E/∂t → displacement current (Ampère-Maxwell)
Note: Electric and magnetic fields are fundamentally interrelated — in special relativity, what appears as a pure electric or pure magnetic field in one reference frame appears as a mixture of both in a moving frame. Together they form the electromagnetic field tensor.

A magnetic field is an invisible force field that surrounds magnets and electric currents, exerting forces on other magnetic materials and moving charges. When electric current flows through a conductor, it generates a magnetic field perpendicular to the direction of current flow. This fundamental principle, discovered by Hans Christian Oersted in 1820, forms the foundation of electromagnetism and countless modern technologies.

Unlike electric fields that emanate from stationary charges, magnetic fields are produced by moving charges (electric current). The magnetic field around a straight current-carrying wire forms concentric circles centered on the wire, with field strength decreasing as you move further away. Understanding how to calculate these fields is essential for designing everything from simple electromagnets to sophisticated MRI machines and particle accelerators.

The strength of a magnetic field is measured in Tesla (T) in the SI system, named after inventor Nikola Tesla. For weaker fields, scientists often use microTesla (uT) or the older CGS unit Gauss (G), where 1 Tesla equals 10,000 Gauss. Earth's magnetic field, for comparison, ranges from about 25 to 65 microTesla depending on location.

The Magnetic Field Formula Explained

B = (mu_0 * I) / (2 * pi * r)
B = Magnetic field (Tesla)
mu_0 = Permeability of free space (4pi x 10^-7 T*m/A)
I = Current (Amperes)
r = Distance from wire (meters)

This formula, derived from Ampere's Law and the Biot-Savart Law, calculates the magnetic field at a perpendicular distance from an infinitely long straight wire carrying steady current. The permeability of free space (mu_0) is a fundamental physical constant that describes how easily magnetic field lines can form in a vacuum.

Understanding Each Variable

  • Magnetic Field (B): The output of our calculation, representing the strength and direction of the magnetic influence at a given point. Higher values mean stronger magnetic effects.
  • Permeability Constant (mu_0): This fundamental constant (4pi x 10^-7 T*m/A or approximately 1.257 x 10^-6 T*m/A) determines how magnetic fields propagate through free space.
  • Current (I): The flow of electric charge through the conductor, measured in Amperes. More current produces a stronger magnetic field.
  • Distance (r): The perpendicular distance from the wire to the point where you're measuring the field. The field weakens with increased distance.

How to Calculate Magnetic Field (Step-by-Step)

1

Identify the Current Value

Determine the electric current flowing through the wire in Amperes (A). This might be given directly or calculated from voltage and resistance using Ohm's Law (I = V/R).

2

Measure the Distance

Measure the perpendicular distance from the wire to the point where you want to calculate the field. Convert to meters if necessary (1 cm = 0.01 m, 1 mm = 0.001 m).

3

Apply the Formula

Substitute your values into B = (4pi x 10^-7 * I) / (2 * pi * r). The pi terms simplify to give B = (2 x 10^-7 * I) / r.

4

Calculate and Convert Units

Perform the calculation to get the magnetic field in Tesla. Convert to other units if needed: multiply by 10^6 for microTesla or by 10^4 for Gauss.

Worked Example: 5A Current at 10cm Distance

Current 5 A
Distance 0.1 m
Result 10 uT

Calculation: B = (2 x 10^-7 * 5) / 0.1 = 10^-5 T = 10 microTesla

The Right-Hand Rule: Determining Field Direction

Knowing the magnitude of a magnetic field is only half the story - you also need to know its direction. The right-hand rule provides an intuitive way to determine the direction of magnetic field lines around a current-carrying wire.

To apply the right-hand rule: Point your right thumb in the direction of conventional current flow (from positive to negative terminal). Your fingers will naturally curl around the wire in the direction of the magnetic field lines. The field forms concentric circles around the conductor, with field lines closer together (stronger field) near the wire and spreading apart (weaker field) farther away.

Pro Tip: Remembering Current Direction

Conventional current flows from positive to negative, opposite to electron flow. When working with circuits, always use conventional current direction for the right-hand rule. This convention, established before electrons were discovered, remains the standard in physics and engineering.

Practical Applications of Magnetic Field Calculations

Understanding magnetic field calculations has numerous real-world applications across science, engineering, and medicine:

Electromagnet Design

Engineers use magnetic field formulas to design electromagnets for industrial lifting, magnetic locks, and relays. By coiling wire into a solenoid, the fields from each turn add together, creating much stronger fields than a single straight wire.

Electric Motors and Generators

Motors convert electrical energy to mechanical motion using magnetic fields, while generators do the reverse. Calculating field strengths helps optimize torque, efficiency, and power output in these devices.

MRI Machines

Medical MRI scanners use powerful magnetic fields (1.5 to 3 Tesla, over 30,000 times Earth's field) to image internal body structures. Understanding magnetic field distribution ensures patient safety and image quality.

Electromagnetic Shielding

Calculating stray magnetic fields helps engineers design shielding for sensitive electronics and protect against electromagnetic interference (EMI).

Safety Warning: Strong Magnetic Fields

Strong magnetic fields can be dangerous. They can interfere with pacemakers and other medical implants, erase magnetic storage media, and cause ferromagnetic objects to become dangerous projectiles. Always follow safety guidelines when working with high-current equipment or strong magnets.

Common Mistakes to Avoid

When calculating magnetic fields, watch out for these frequent errors:

  • Unit Confusion: Always convert distances to meters before calculating. Using centimeters or millimeters directly will give incorrect results.
  • Forgetting the Permeability Constant: The mu_0 term is essential - without it, your answer will be off by several orders of magnitude.
  • Ignoring Field Direction: The magnitude alone doesn't tell the whole story. Use the right-hand rule to determine field direction, especially when multiple wires are involved.
  • Assuming the Formula Works for All Geometries: The straight wire formula only applies to long, straight conductors. Coils, solenoids, and other geometries require different formulas.
  • Not Considering Material Effects: The formula assumes free space (vacuum). Magnetic materials can significantly alter field strength through their relative permeability.

Pro Tip: Quick Estimation

For quick mental calculations, remember that 2 x 10^-7 is approximately 0.0000002. So for 1 Ampere at 1 meter distance, the field is about 0.2 microTesla. Scale proportionally from there for different currents and distances.

Advanced Concepts: Beyond the Straight Wire

While this calculator focuses on straight wires, understanding related concepts helps in more complex scenarios:

Solenoids

A solenoid (coiled wire) creates a nearly uniform field inside: B = mu_0 * n * I, where n is the number of turns per unit length. This field is much stronger than a single wire can produce.

Magnetic Field Superposition

When multiple currents are present, calculate each field separately and add them vectorially. Parallel currents in the same direction attract; opposite directions repel.

Biot-Savart Law

For complex geometries, the Biot-Savart Law allows calculation of the field contribution from each small segment of current-carrying wire, then integrates over the entire conductor.

What significant figures should I use?
Match your significant figures to your least precise input. If you measured a length to 3 sig figs, report your answer to 3 sig figs regardless of how many decimal places the calculator shows. Excess decimal places imply false precision and are misleading in scientific reporting.