Simplify Your Workflow: Search MiniWebtool.
Add Extension
See also
Electric Field CalculatorRing and Field CalculatorCoulomb's Law CalculatorElectricity CalculatorGroup Theory Order CalculatorZ-Transform Calculator
Home Page > Miscellaneous > Physics Calculators > Magnetic Field of Wire Calculator

Magnetic Field of Wire Calculator

Compute the magnetic field B around a current-carrying conductor using the Biot–Savart law and Ampère's law. Three geometries in one tool: an infinite straight wire, a circular current loop (on-axis), and a finite or ideal solenoid with optional ferromagnetic core. Solve for B, current I, distance r, loop radius R, axial position z, turns N, or solenoid length L, with a live SVG that draws the encircling field lines, the right-hand-rule direction, and the inside-vs-outside field strength side-by-side with real-world references (Earth, fridge magnet, MRI, neutron star).

Magnetic Field of Wire Calculator
⚡ Quick examples
1 What do you want to find?
Pick the unknown — its input row hides itself automatically.
1 What do you want to find?
On-axis Biot–Savart. The unknown's input hides itself.
1 What do you want to find?
Ideal = long-coil approximation. Finite = exact on-axis B at the centre using the coil radius for the end correction.
2 Current I in the wire
Sign matters — a negative value flips the field direction (right-hand rule).
3 Distance r from the wire
Perpendicular distance to the wire. Must be greater than zero.
3 Loop radius R
Radius of the single circular loop carrying the current.
4 Axial distance z from loop center
z = 0 gives the field at the loop centre. Far away (z ≫ R) gives the magnetic-dipole approximation.
3 Number of turns N
Total number of wire turns wound around the solenoid.
4 Solenoid length L
Length along the solenoid axis. The turn density is n = N / L.
5 Coil radius R (finite model)
Average radius of the windings. Only used for the finite-length end correction.
Magnetic field B (only when B is NOT the unknown)
Choose tesla, mT, µT, nT or gauss — all converted internally.
μ Surrounding medium or core
Iron and mu-metal multiply the empty-coil field by hundreds to tens of thousands — until they saturate around 1.5 to 2 T.

Embed Magnetic Field of Wire Calculator Widget

About Magnetic Field of Wire Calculator

The Magnetic Field of Wire Calculator computes the magnetic flux density \( B \) produced by a current-carrying conductor for the three geometries that dominate every electromagnetism course: an infinite straight wire (\( B = \mu_0 \mu_r I / 2\pi r \)), a circular current loop on its axis (\( B(z) = \mu_0 \mu_r I R^{2} / [2(R^{2}+z^{2})^{3/2}] \)), and an ideal or finite solenoid (\( B = \mu_0 \mu_r n I \) for the long-coil limit; with a \( \cos\theta \) end-correction for finite length). Solve for any unknown — B, current I, distance r, loop radius R, axial position z, number of turns N, or solenoid length L — with full SI unit conversion (microamps to kiloamps, micrometres to kilometres, nanotesla to kilogauss), a built-in catalogue of ferromagnetic core materials (iron, ferrite, mu-metal, custom \( \mu_r \)), live SVG previews of the field lines, and a step-by-step LaTeX derivation. Every result is captioned with a real-world reference, from Earth's field (≈ 50 µT) and a fridge magnet (≈ 5 mT) up to a clinical MRI scanner (1.5 T) and pulsed laboratory magnets (above 1000 T).

How to Use This Magnetic Field of Wire Calculator

  1. Pick a geometry at the top. Straight wire uses Ampère's law for an infinite wire. Circular loop uses the on-axis Biot–Savart formula. Solenoid uses the long-coil Ampère result, with an optional finite-length cosine correction.
  2. Choose what to solve for. For a straight wire you can solve for B, I, or r. For a loop you can solve for B, I, R, or z. For a solenoid you can solve for B, I, N, or L. The matching input hides itself so you cannot accidentally over-constrain the problem.
  3. Type in the remaining values with your preferred units. Mixing units across rows is fine — every quantity is converted into SI internally.
  4. Pick the surrounding medium or core. Vacuum and air leave the field unchanged. An iron core multiplies the empty-coil field by roughly 5,000× — until the iron saturates above 1.5–2 T. Pick Custom µ_r for any other material.
  5. Press Calculate and read the field magnitude in tesla and gauss, the step-by-step derivation, an animated SVG of the field lines, and a real-world comparison.

What Makes This Calculator Different

Three geometries — one tool Most online calculators handle only the infinite straight wire. This one also computes the circular loop (Biot–Savart) and the solenoid (Ampère's law) in the same form, so you can switch geometry without leaving the page.
Solve for any unknown Pick B, I, r, R, z, N, or L as the unknown. The calculator rearranges the formula symbolically (or numerically when needed, e.g. cube-root for z on the loop axis) and hides the matching input so the problem is always well-posed.
Finite-solenoid end-correction Short solenoids do not satisfy the L ≫ R assumption of the textbook formula. Switch to the finite model and supply the coil radius — the calculator multiplies by \( \cos\theta = (L/2)/\sqrt{(L/2)^{2}+R^{2}} \) so the centre-field number matches the exact Biot–Savart result.
Ferromagnetic cores done right Vacuum, water, copper (diamagnetic), aluminium (paramagnetic), soft ferrite (µ_r ≈ 640), pure iron (µ_r ≈ 5000), and mu-metal (µ_r ≈ 50 000) presets, with a custom slot for any other µ_r ≥ 0. Notes warn when you push above the saturation flux density of real iron.
Live, animated SVG preview Each mode has its own preview: concentric field circles around a wire, dipole-style closed loops around a circular coil, and a uniform-inside / closed-outside picture for a solenoid. Animations switch direction by the sign of I.
Real-world reference labels Every result is captioned with the closest familiar reference: Earth's field (~ 50 µT), fridge magnet (~ 5 mT), MRI (1.5 T), pulsed lab magnet (~ 100 T), neutron star (~ 10¹⁰ T). At a glance you see whether your number is plausible or pathological.

The Three Formulas

Infinite straight wire — Ampère's law applied to a circular Amperian loop centred on the wire:

\[ B \;=\; \dfrac{\mu_0 \mu_r I}{2 \pi r} \]

Circular current loop, on its axis at distance z from the centre — Biot–Savart law integrated around the loop:

\[ B(z) \;=\; \dfrac{\mu_0 \mu_r I R^{2}}{2 \left(R^{2}+z^{2}\right)^{3/2}} \]

At the loop centre (z = 0) this reduces to \( B_0 = \mu_0 \mu_r I / (2R) \). For z ≫ R it approaches the magnetic-dipole far-field \( B \approx \mu_0 m / (2\pi z^{3}) \) with magnetic moment \( m = I\pi R^{2} \).

Solenoid — ideal long coil from Ampère's law:

\[ B \;=\; \mu_0 \mu_r n I, \qquad n = N / L \]

For a finite-length solenoid, the field at the centre on the axis is multiplied by the geometric correction \( \cos\theta = (L/2)/\sqrt{(L/2)^{2}+R^{2}} \), which approaches 1 only when \( L \gg R \).

Worked Example: Household Wire

  • 5 A flowing in a single straight wire, measured 5 cm away.
  • \( B = (4\pi \times 10^{-7}) \times 5 / (2\pi \times 0.05) = 2 \times 10^{-5}\) T = 20 µT.
  • For comparison, Earth's magnetic field at the surface is ≈ 50 µT — so a typical household appliance lead produces about 40% of the natural field at 5 cm away, which is why a compass needle wobbles when you bring it close to a powered wire.

Worked Example: Circular Loop at Its Centre

  • 2 A in a single loop of radius 10 cm, field measured at the loop centre (z = 0).
  • \( B = \mu_0 I / (2R) = (4\pi \times 10^{-7}) \times 2 / (2 \times 0.10) \approx 1.26 \times 10^{-5}\) T = 12.6 µT.
  • Already weaker than Earth's field at the surface — single-loop electromagnets are surprisingly inefficient unless you wind many turns into a coil (solenoid).

Worked Example: Air-Core Solenoid

  • 500 turns wound into a 20 cm long coil, carrying 5 A.
  • Turn density n = 500 / 0.20 = 2 500 turns/m.
  • \( B = \mu_0 n I = (4\pi \times 10^{-7}) \times 2500 \times 5 \approx 1.57 \times 10^{-2}\) T = 15.7 mT.
  • About 3× a fridge magnet (~ 5 mT). Add a soft-iron core (µ_r ≈ 5000) and the field jumps to about 78 T — well above iron's saturation, so in practice the iron caps out near 1.5–2 T.

Right-Hand Rule, in Three Forms

  • Straight wire: point your right thumb in the direction of the conventional current I; the fingers naturally curl in the direction of the B field around the wire.
  • Circular loop: curl the fingers of your right hand around the loop in the direction the current flows; the thumb points along B on the axis.
  • Solenoid: same as the loop — fingers follow the winding, thumb points along the field inside the coil (i.e. north end of the equivalent bar magnet).

Common Magnetic-Field Magnitudes

Scenario|B|Notes
Intergalactic magnetic field~ 10⁻⁹ nTThe faintest fields measured in astrophysics.
Brain (MEG signal)~ 10 fT – 1 pTDetectable only with SQUID magnetometers in shielded rooms.
Earth's surface field25 – 65 µTWhat a compass needle responds to.
5 A household wire at 5 cm≈ 20 µTComparable to Earth's field. Compasses wobble nearby.
Fridge magnet~ 5 mTStrong enough to lift small steel objects.
Modern neodymium magnet (surface)~ 1 TWill pinch fingers — handle with care.
Clinical MRI1.5 – 3 TWrenches loose iron objects across the room. The reason MRI rooms are strictly screened.
Research electromagnet (continuous)30 – 45 TLiquid-helium-cooled superconducting magnets at facilities like NHMFL.
Pulsed laboratory magnet≈ 100 TCapacitor-bank discharges lasting milliseconds.
Magnetar (neutron-star type)10¹⁰ – 10¹¹ TStrongest fields known in the universe — would erase a credit-card strip from the Moon.

Tips for Solenoid Design

  • Long & thin wins. The ideal-solenoid formula \( B = \mu_0 n I \) assumes L ≫ R. For short coils, switch to the finite model and supply the coil radius. The end-correction \( \cos\theta \) drops from 1 (when L → ∞) down to 0.7 around L ≈ R.
  • µ_r is not magic. Soft iron multiplies B by ≈ 5000 at low fields, but real iron saturates around 1.5–2 T. Above that, raising the current barely raises B and most of the energy goes into eddy losses and heat.
  • Pulsed > continuous for high fields. Continuous magnets cap around 45 T because of cooling. Pulsed magnets reach 100 T+ by discharging a capacitor bank for milliseconds — long enough to do physics, short enough to avoid melting.
  • Mind the ohmic budget. The power dissipated is \( P = I^{2} R_{\text{wire}} \). Doubling turns to double n at the same current quadruples the resistance (wire is now twice as long), so the heat goes up 4× even though B only goes up 2×.

Frequently Asked Questions

What is the formula for the magnetic field of a long straight wire?
\( B = \mu_0 I / (2\pi r) \), where \( \mu_0 = 4\pi \times 10^{-7}\) T·m/A is the vacuum permeability and r is the perpendicular distance to the wire. Multiply by the medium's relative permeability \( \mu_r \) when not in vacuum.

What is the magnetic field at the center of a circular current loop?
\( B_0 = \mu_0 I / (2R) \) at the geometric centre, where R is the loop radius. On the axis at distance z it generalizes to \( B(z) = \mu_0 I R^{2} / [2(R^{2}+z^{2})^{3/2}] \).

What is the magnetic field inside a solenoid?
For an ideal long solenoid, \( B = \mu_0 \mu_r n I \), where n = N/L is the turn density. Inside an ideal coil this field is uniform and parallel to the axis; outside, the field looks like a bar magnet's. The calculator also handles the finite-length correction when L is not much larger than the coil radius R.

How do I use the right-hand rule for a current?
For a straight wire, point your right thumb along the conventional current and your fingers curl in the direction of B. For a loop or solenoid, curl the fingers in the direction of current flow and the thumb points along the on-axis B field (equivalent to the bar-magnet north pole).

Does the surrounding medium change the magnetic field?
Yes. The vacuum permeability \( \mu_0 \) is replaced by \( \mu = \mu_0 \mu_r \) in any medium. Air, water, and most non-magnetic materials have µ_r ≈ 1. Iron and other ferromagnets have µ_r in the thousands, which is why electromagnets use iron cores. Diamagnetic materials like copper have µ_r slightly less than 1.

What is the difference between B and H?
B (in tesla) is the magnetic flux density, the quantity that appears in the Lorentz force law \( F = qv \times B \) and that this calculator reports. H = B/(µ_0 µ_r) is the auxiliary "magnetic field intensity" in A/m, useful when you want to separate the source current from the material response. Most physics courses use B; most materials-science contexts use H.

What is the difference between Biot–Savart and Ampère's law?
Biot–Savart gives the contribution from each tiny current element; integrate over the geometry. It always works but the integrals can be hard. Ampère's law gives a closed-form B only in symmetric geometries (infinite wire, infinite solenoid, toroid) but is much faster when symmetry helps. This calculator uses Ampère's law for the wire and the ideal solenoid; Biot–Savart for the loop and the finite-solenoid correction.

Can I solve for the current instead of B?
Yes. In every mode use the Solve for selector to pick the unknown. The calculator rearranges the formula and hides the unknown's input so you cannot over-constrain the problem.

Reference this content, page, or tool as:

"Magnetic Field of Wire Calculator" at https://MiniWebtool.com/magnetic-field-of-wire-calculator/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: 2026-05-17

Physics Calculators:

Top & Updated:

Instagram User ID LookupRandom PickerRandom Name Picker WheelImage ResizerFacebook User ID LookupLine CounterRSD Calculator - Relative Standard DeviationSort NumbersFPS ConverterMAC Address GeneratorRemove SpacesWord to Phone Number ConverterSun, Moon & Rising Sign Calculator 🌞🌙✨📷 OCR / Image to Text⬛ Aspect Ratio CalculatorRandom Quote GeneratorERA CalculatorMAC Address Lookup🖱️ Click CounterSquare Root (√) CalculatorMerge VideosSlope and Grade CalculatorJob FinderPercent Off CalculatorSum CalculatorWeight Loss CalculatorSHA256 Hash GeneratorBatting Average CalculatorCm to Feet and Inches ConverterRandom Truth or Dare GeneratorMP3 LooperRandom Poker Hand GeneratorAdd Text to ImageVertical Jump CalculatorRandom Credit Card GeneratorRoman Numerals ConverterNumber of Digits CalculatorAudio SplitterRandom Fake Address GeneratorRandom IMEI GeneratorLog Base 10 CalculatorInvisible Text GeneratorFeet and Inches to Cm ConverterRandom Birthday GeneratorPhone Number ExtractorBitwise CalculatorJulian Date ConverterImage SplitterRandom Superpower GeneratorRandom Writing Prompt GeneratorSalary Conversion CalculatorNumber to Word ConverterSun Position CalculatorName RandomizerText FormatterLunar Calendar ConverterRandom Activity GeneratorCaffeine Overdose CalculatorIP Subnet CalculatorOctal CalculatorHalfway Date CalculatorBCD ConvertereBay Fee CalculatorCompound Growth CalculatorRandom Movie PickerBolt Torque CalculatorLong Division CalculatorFile Size ConverterBinary to Gray Code ConverterImage CompressorYouTube Channel StatisticsWord Ladder GeneratorQuotient and Remainder CalculatorEmail ExtractorStair CalculatorSHA512 Hash GeneratorOutlier CalculatorRandom Meal GeneratorVideo CompressorHebrew Calendar ConverterLeap Years ListFirst n Digits of PiOPS CalculatorBCD to Decimal ConverterWAR CalculatorRandom Loadout GeneratorBreak Line by CharactersList of Prime NumbersMultiplication CalculatorStandard Error CalculatorBcrypt Hash Generator / Checker📅 Date CalculatorSlugging Percentage Calculator🔍 Plagiarism CheckerAPI TesterMD5 Hash GeneratorRandomize NumbersAI Language DetectorURL ExtractorFlip VideoDMS to Decimal Degrees ConverterMaster Number CalculatorBroken Link CheckerCompare Two StringsMultiple Fraction CalculatorRandom Number Picker🎰 Gacha Pity CalculatorAstrological Element Balance Calculator🔊 Tone GeneratorArc Length CalculatorVideo to Image ExtractorEstimation CalculatorIP Address to Hex ConverterWhat is my Zodiac Sign?Add Prefix and Suffix to TextIs it a Prime Number?Percent to PPM ConverterRandom Emoji GeneratorRemove AccentSocial Media Username CheckerBingo Card GeneratorNumber ExtractorOn Base Percentage CalculatorPercent Growth Rate CalculatorRandom Tournament Bracket GeneratorTime Duration CalculatorDay of the Year Calculator - What Day of the Year Is It Today?Cone Flat Pattern (Template) GeneratorLottery Number GeneratorName Number CalculatorAcreage CalculatorBattery Life CalculatorDay of Year CalendarLED Resistor CalculatorModulo CalculatorRatio CalculatorList RandomizerSocial Media Post Time OptimizerGray Code to Binary ConverterRandom Math Problem GeneratorRandom User-Agent GeneratorVideo SplitterRatio to Percentage CalculatorYouTube Tag ExtractorRandom Chord GeneratorSmall Text Generator ⁽ᶜᵒᵖʸ ⁿ ᵖᵃˢᵗᵉ⁾Word Scramble GeneratorIP Address to Binary ConverterChinese Gender PredictorDecibel (dB) CalculatorRandom Video Thumbnail GeneratorSquare Numbers ListConnect the Dots GeneratorMercury Retrograde CalendarImage CropperSaturn Return CalculatorFraction CalculatorRemove Line BreaksProportion CalculatorOrder of Operations Calculator (PEMDAS)Random PIN GeneratorScientific Notation to Decimal ConverterRandom Line PickerMagic 8-Ball📊 Bar Graph MakerLove Compatibility CalculatorText Case ConverterColor InverterAdjust Video SpeedFirst n Digits of eWhat is my Lucky Number?Random Excuse GeneratorBinary to BCD Converter💧 Dew Point CalculatorImage EnhancerRadical SimplifierTaco Bar CalculatorLbs to Kg ConverterPER CalculatorTrigonometric Equation SolverPregnancy CalendarReverse VideoHeight Percentile CalculatorBackronym GeneratorMcg to Mg ConverterPaycheck Calculator (Take-Home Pay)Random Object GeneratorWHIP CalculatorAmortization CalculatorGolden Ratio CalculatorAngel Number CalculatorInvisible Character RemoverWhitespace VisualizerAI Text HumanizerCrossword Puzzle MakerHTML CompressorParabola CalculatorRandom Chess Opening GeneratorAI ParaphraserAI Punctuation AdderSort Lines AlphabeticallyHex to BCD ConverterBCD to Binary ConverterBCD to Hex ConverterMedian CalculatorAverage CalculatorPVIFA CalculatorHypotenuse CalculatorRemove Audio from VideoActual Cash Value CalculatorLog Base 2 CalculatorRoot Mean Square CalculatorSum of Positive Integers CalculatorSHA3-256 Hash GeneratorAI Sentence ExpanderHex to Decimal ConverterRandom Group GeneratorConvolution CalculatorMAC Address AnalyzerRandom String GeneratorRemove Leading Trailing SpacesMarkup CalculatorPVIF CalculatorDecimal to Hex ConverterInstagram Font GeneratorSocial Media Image Size GuideTikTok Money CalculatorTwitter/X Character CounterTwitter/X Timestamp ConverterYouTube Watch Time CalculatorTwitch Earnings CalculatorYouTube Shorts Monetization CalculatorFacebook Ad Cost CalculatorSocial Media ROI CalculatorCTR CalculatorROAS CalculatorInfluencer ROI CalculatorForce CalculatorAcceleration CalculatorVelocity CalculatorMomentum CalculatorProjectile Motion CalculatorKinetic Energy CalculatorPotential Energy CalculatorWork and Power CalculatorDensity CalculatorPressure CalculatorIdeal Gas Law CalculatorFree Fall CalculatorTorque CalculatorHorsepower CalculatorDilution CalculatorChemical Equation BalancerStoichiometry CalculatorPercent Yield CalculatorEmpirical Formula CalculatorBoiling Point CalculatorTitration CalculatorMole/Gram/Particle ConverterIrregular Polygon Area CalculatorFrustum CalculatorTorus Calculator3D Distance CalculatorGreat Circle Distance CalculatorCircumscribed Circle (Circumcircle) CalculatorInscribed Circle (Incircle) CalculatorAngle Bisector CalculatorTangent Line to Circle CalculatorHeron's Formula CalculatorCoordinate Geometry Distance CalculatorVolume of Revolution CalculatorSurface of Revolution CalculatorParametric Curve GrapherRiemann Sum CalculatorTrapezoidal Rule CalculatorSimpson's Rule CalculatorImproper Integral CalculatorL'Hôpital's Rule CalculatorMaclaurin Series CalculatorPower Series CalculatorSeries Convergence Test CalculatorInfinite Series Sum CalculatorAverage Rate of Change CalculatorInstantaneous Rate of Change CalculatorRelated Rates SolverOptimization Calculator (Calculus)Gradient Calculator (Multivariable)Divergence CalculatorCurl CalculatorLine Integral CalculatorSurface Integral CalculatorJacobian Matrix CalculatorNewton's Method CalculatorRREF Calculator (Row Echelon Form)Matrix Inverse CalculatorMatrix Multiplication CalculatorDot Product CalculatorCross Product CalculatorVector Magnitude CalculatorUnit Vector CalculatorAngle Between Vectors CalculatorNull Space CalculatorColumn Space CalculatorCramer's Rule CalculatorMatrix Diagonalization CalculatorQR Decomposition CalculatorCholesky Decomposition CalculatorMatrix Power CalculatorCharacteristic Polynomial CalculatorBayes' Theorem CalculatorF-Test / F-Distribution CalculatorHypergeometric Distribution CalculatorNegative Binomial Distribution CalculatorGeometric Distribution CalculatorExponential Distribution CalculatorWeibull Distribution CalculatorBeta Distribution CalculatorSpearman Rank Correlation CalculatorFisher's Exact Test CalculatorContingency Table CalculatorOdds Ratio CalculatorBernoulli Equation CalculatorSurfboard Volume CalculatorTennis Grip Size CalculatorBackpack Size CalculatorCelsius to Fahrenheit ConverterFahrenheit to Celsius ConverterKm to Miles ConverterMiles to Km ConverterMM to Inches ConverterInches to MM ConverterStone to Kg ConverterKg to Stone ConverterLiters to Gallons ConverterGallons to Liters ConverterML to Oz ConverterOz to ML ConverterSquare Meters to Square Feet ConverterSquare Feet to Square Meters ConverterCubic Feet to Cubic Yards ConverterCubic Meters to Cubic FeetKnots to MPH ConverterMPH to KMH / KMH to MPHMg to Ml ConverterAI Text SummarizerAI TranslatorAI Story GeneratorAI Poem GeneratorAI Song Lyrics GeneratorIndian Land Unit ConverterTola to Gram ConverterPX to REM ConverterPT to PX ConverterMerge PDFSplit PDFCompress PDFPDF to JPGJPG to PDFRotate PDFDelete PDF PagesAdd Page Numbers to PDFProtect PDFReorder PDF PagesPDF Word CounterPDF Page ExtractorPDF to Text ExtractorUnlock PDF (Owner-Password Removal)PDF Flatten ToolAI Rap Lyrics GeneratorAI Cover Letter GeneratorAI Resume Bullet GeneratorAI LinkedIn Headline & Bio GeneratorAI Instagram Caption GeneratorAI YouTube Title & Description GeneratorAI Video Script GeneratorAI Product Description GeneratorAI Press Release GeneratorAI Wedding Speech GeneratorAI Thank-You Note GeneratorAI Dream InterpreterRandom Question GeneratorWould You Rather GeneratorNever Have I Ever GeneratorIcebreaker Question GeneratorCharades GeneratorPictionary Word GeneratorHangman Word GeneratorTrivia Question GeneratorRandom Fact GeneratorRandom Joke GeneratorDad Joke GeneratorPickup Line GeneratorCompliment GeneratorDaily Affirmation GeneratorJournal Prompt GeneratorDrawing Idea GeneratorFortune Cookie GeneratorFantasy Name GeneratorCapacitor Bank Sizing CalculatorSolar Charge Controller Sizing CalculatorBattery C-Rate CalculatorBattery Internal Resistance CalculatorPeukert Battery Runtime CalculatorWire Resistance CalculatorPCB Via Current CalculatorBand Name GeneratorRap Name GeneratorNickname GeneratorTeam Name GeneratorGamertag Generator