Simplify Your Workflow: Search MiniWebtool.
Add Extension
> 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// from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: 2026-05-17

Top & Updated:

Random PickerRandom Name PickerLine CounterRelative Standard Deviation CalculatorBatting Average CalculatorFPS ConverterSort NumbersERA CalculatorInstagram User ID LookupMAC Address GeneratorRemove SpacesJob FinderWord to Phone Number ConverterFacebook User ID LookupFeet and Inches to Cm ConverterMAC Address LookupRandom Truth or Dare GeneratorSum CalculatorOPS CalculatorPercent Off CalculatorSHA256 Hash GeneratorLog Base 10 CalculatorSquare Root (√) CalculatorRandom Letter GeneratorNumber of Digits CalculatorSlope and Grade CalculatorBitwise CalculatorVertical Jump CalculatorMP3 LooperAudio SplitterPhone Number ExtractorRandom Quote GeneratorSalary Conversion CalculatorRandom IMEI GeneratorOn Base Percentage CalculatorSlugging Percentage CalculatorNumber to Word ConverterImage ResizerRoman Numerals ConverterAI Text HumanizerCaffeine Overdose CalculatorRandom Poker Hand GeneratorSun, Moon & Rising Sign Calculator 🌞🌙✨Merge VideosSaturn Return CalculatorCm to Feet and Inches ConverterCompound Growth CalculatorRandom Writing Prompt GeneratorRandom Activity GeneratorRandom Movie PickerDecimal to BCD ConverterGrade CalculatorRandom Birthday GeneratorWAR CalculatorText FormatterVideo to Image ExtractorRandom Loadout GeneratorRandom Fake Address GeneratorRandom Object GeneratorBCD to Decimal ConverterRandom Superpower GeneratorFirst n Digits of PiInvisible Text GeneratorBinary to Gray Code ConverterOctal CalculatorWHIP CalculatorLove Compatibility CalculatorFile Size ConverterRemove AccentCompare Two StringsTime Duration CalculatorAdd Prefix and Suffix to TextBingo Card GeneratorRandom Credit Card GeneratorRandom Time GeneratorCM to Inches ConverterMaster Number CalculatorYouTube Channel StatisticsWord Ladder GeneratorOutlier CalculatorList of Prime Numbers⬛ Aspect Ratio CalculatorQuotient and Remainder CalculatorUnit Rate CalculatorDay of Year CalendarPercent Growth Rate CalculatorCryptogram GeneratorBinary to BCD ConverterLeap Years ListRandom Chess Opening GeneratorDay of the Year Calculator - What Day of the Year Is It Today?Arc Length CalculatorGray Code to Binary ConverterRandom Meal GeneratorImage SplitterClothing Size ConverterStair CalculatorSteel Weight CalculatorAdd Text to ImageEmail ExtractorURL ExtractorAI ParaphraserAI Punctuation AdderSHA512 Hash GeneratorVideo CompressorIP Address to Hex ConverterSort Lines AlphabeticallyHex to BCD ConverterBCD to Binary ConverterLottery Number GeneratorBCD to Hex ConverterMedian CalculatorStandard Error CalculatorList RandomizerBreak Line by CharactersAverage CalculatorModulo CalculatorPVIFA CalculatorReverse VideoHypotenuse CalculatorRemove Audio from VideoActual Cash Value CalculatorScientific Notation to Decimal ConverterNumber ExtractorAngel Number CalculatorLog Base 2 CalculatorRoot Mean Square CalculatorSum of Positive Integers CalculatorSHA3-256 Hash GeneratorAI Sentence Expander📅 Date CalculatorLbs to Kg ConverterHex to Decimal ConverterRandom Group GeneratorConvolution CalculatorMAC Address AnalyzerRandom String GeneratorRemove Leading Trailing SpacesAmortization CalculatorMarkup CalculatorPVIF CalculatorName Number 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 CalculatorSocial Media Post Time OptimizerSocial Media Username CheckerCTR 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 CalculatorRelative Risk CalculatorEffect Size CalculatorPermutations with Repetition CalculatorModular Exponentiation CalculatorPrimitive Root CalculatorPerfect Number CheckerAmicable Number CheckerTwin Prime FinderMersenne Prime CheckerGoldbach Conjecture VerifierMöbius Function CalculatorEgyptian Fraction CalculatorFibonacci Number CheckerDigital Root CalculatorPartition Function CalculatorBoolean Algebra SimplifierKarnaugh Map (K-Map) SolverLogic Gate SimulatorGraph Coloring CalculatorTopological Sort CalculatorAdjacency Matrix CalculatorRecurrence Relation SolverInclusion-Exclusion CalculatorLinear Programming SolverTraveling Salesman Solver (TSP)Hamiltonian Path CheckerPlanar Graph CheckerNetwork Flow Calculator (Max Flow)Stable Marriage Problem SolverFirst-Order ODE SolverSecond-Order ODE SolverDirection Field / Slope Field PlotterEuler's Method CalculatorBernoulli ODE SolverSystem of ODEs SolverGroup Theory Order CalculatorRing and Field CalculatorJordan Normal Form CalculatorMatrix Exponential CalculatorTensor Product CalculatorFast Fourier Transform (FFT) CalculatorZ-Transform CalculatorNumerical Integration CalculatorTOML to JSON ConverterJSON to CSV ConverterXML to JSON ConverterSQL to MongoDB Query ConverterCSS Flexbox PlaygroundCSS Grid GeneratorJWT GeneratorBcrypt Hash Generator / CheckerColor Code Converter (All Formats)Git Command Generator.env File GeneratorLorem Picsum / Placeholder Image GeneratorText to Binary/Hex/ASCII ConverterSyllable CounterSentence CounterParagraph CounterSpeaking Time CalculatorReading Time CalculatorWhitespace VisualizerStrikethrough Text GeneratorTorque Converter (Nm, ft-lb, kgf-cm)Data Transfer Rate ConverterFuel Efficiency ConverterAstronomical Unit ConverterRing Size ConverterPaper Size ReferenceGas Mileage CalculatorEV Range CalculatorEV Charging Time Calculator0–60 / Quarter Mile CalculatorCar Lease CalculatorVehicle Towing Capacity CalculatorExposure Triangle CalculatorCrop Factor CalculatorMegapixel to Print Size CalculatorPhoto File Size EstimatorMusic BPM TapperMusic Key TransposerVideo Bitrate CalculatorSeed Germination Rate CalculatorFertilizer Calculator (NPK)Raised Bed Soil CalculatorFrost Date CalculatorLawn Fertilizer CalculatorCompost Calculator (C:N Ratio)Solar Panel CalculatorSolar ROI CalculatorHome Energy Audit CalculatorAppliance Energy Cost CalculatorWater Usage CalculatorElectricity Generation Cost CalculatorHeat Loss CalculatorFlight Distance CalculatorTravel Budget CalculatorJet Lag CalculatorPacking List GeneratorTip Splitter (Advanced)Lease vs Buy CalculatorHourly Rate Calculator (Freelancer)Invoice Late Fee CalculatorESPP CalculatorStock Split CalculatorOptions Probability CalculatorDollar to Gold ConverterBeam Load CalculatorPipe Flow CalculatorBolt Torque CalculatorGravel, Sand & Topsoil CalculatorRandom Sentence GeneratorRandom Paragraph GeneratorRandom Math Problem GeneratorRandom Bible Verse GeneratorRandom Cat/Dog Name GeneratorRandom Debate Topic GeneratorBody Recomposition CalculatorAlcohol Calorie CalculatorMedication Dosage CalculatorPace to Calories CalculatorHydration CalculatorTrain Meeting Problem SolverAge Word Problem SolverMixture Problem SolverWork Rate Problem SolverDistance-Speed-Time Triangle CalculatorCoin Word Problem SolverNumber Bonds GeneratorCarry and Borrow VisualizerTimes Tables QuizMental Math TrainerRoman Numeral Math SolverEgyptian Multiplication CalculatorVedic Math Tricks CalculatorRussian Peasant MultiplicationSoroban Abacus SimulatorAnnuity Payout CalculatorReverse Mortgage CalculatorVariable Annuity CalculatorFixed Indexed Annuity CalculatorBond Convexity CalculatorBond Duration Calculator (Macaulay & Modified)Forward Rate CalculatorMortgage Recast CalculatorTreasury Inflation-Protected Securities (TIPS) CalculatorStock Beta CalculatorTreynor Ratio CalculatorSortino Ratio CalculatorDoppler Effect CalculatorSpring Constant CalculatorPendulum Period CalculatorCentripetal Force CalculatorAngular Velocity CalculatorMoment of Inertia CalculatorSnell's Law CalculatorCoulomb's Law CalculatorElectric Field CalculatorMagnetic Field of Wire CalculatorLens Equation CalculatorA/B Test Significance CalculatorA/B Test Sample Size Calculator