Magnetic Field Calculator
What is the Magnetic Field Calculator?
What this calculator does
Enter a current and a distance, and the calculator returns the magnetic field around a long straight wire. The same current feeds a solenoid calculation based on turns per meter. A third result estimates the force on a charged particle moving through the wire's field.
Two geometries, two field formulas
A straight wire wraps its field in circles around itself, weakening with distance. A solenoid, a coil wound in a helix, concentrates a nearly uniform field inside its bore. The two shapes answer different questions, so the page computes both from one shared Current (I) input.
The wire field: B = μ0 × I / (2 × pi × r). Field strength grows in direct proportion to the current and falls as one over the distance r, not one over r squared. Halve the distance and the field doubles. The constant μ0, the permeability of free space, is taken as 1. 2566 × 10⁻⁶ here.
The solenoid field: B = μ0 × n × I
Inside a long solenoid the field depends on the current and on n, the turns packed into each meter, and not on position inside the bore. Double the winding density and the field doubles. The formula describes an air-core coil; iron cores multiply the result and are not modeled here.
The force on a charge: F = q × v × B
A particle with charge q moving at velocity v perpendicular to a field feels a force proportional to both, and to the field itself. This calculator applies the force formula to the wire field only, not to the solenoid field, and returns the magnitude, not the direction.
Reading the Field of Straight Wire result
This output carries six decimal places in teslas, because wire fields at everyday currents are small. The page defaults, 10 amps at 0. 05 meters, give 0. 000040 teslas, or 40 microteslas. That is the same order as Earth's own magnetic field, a useful anchor for judging other results.
Reading the Field Inside Solenoid result
This output is reported in teslas to four decimal places. The defaults pair the same 10 amps with 1,000 turns per meter and produce 0. 0126 teslas, about 12. 6 milliteslas. That is roughly two and a half times the pull of a typical refrigerator magnet's surface field of about 5 milliteslas.
Reading the Force on Charge result
Force is reported in newtons to four decimal places, and for single particles that is a problem: an electron's charge is so small that the true force rounds to 0. 0000. The default electron case works out to about 6. 4 × 10⁻¹⁸ newtons by hand. Treat a displayed zero as tiny, not as nothing.
The tesla, and how big it really is
One tesla is a strong field: hospital MRI scanners operate at 1. 5 to 3 teslas. Everyday fields are far weaker. Earth's field runs about 25 to 65 microteslas, and a power line's field a meter away is measured in single microteslas. Most results on this page live in microteslas and milliteslas.
The constant μ0 and the 2019 SI change
The calculator uses μ0 = 1. 2566 × 10⁻⁶, the rounded value of 4 × pi × 10⁻⁷. Before 2019 that figure was exact by definition. Since the SI revision it is a measured constant; NIST lists it near 1. 25663706212 × 10⁻⁶, a difference too small to move any result at these precisions.
Worked example: the page defaults
With Current at 10 amps, Distance from Wire at 0. 05 meters, and Solenoid Turns per Meter at 1,000, the wire field is 0. 000040 teslas and the solenoid field is 0. 0126 teslas. The electron defaults, charge 1. 6 × 10⁻¹⁹ coulombs at 1,000,000 meters per second, produce the hand-computed force of about 6. 4 × 10⁻¹⁸ newtons.
Worked example: close to a 25 amp conductor
Raise the current to 25 amps and move in to 0. 02 meters. The wire field climbs to 0. 000250 teslas, 250 microteslas, because the current rose two and a half times while the distance shrank two and a half times. At 2,500 turns per meter, the solenoid field reaches 0. 0785 teslas.
Worked example: a 200 amp busbar
Industrial busbars carry hundreds of amps. At 200 amps, the field 0. 1 meters away is 0. 000400 teslas, or 400 microteslas, roughly ten times Earth's field. This is why sensitive instruments and compasses are kept clear of high-current DC feeds, and why those fields matter in substation layout work.
Worked example: standing a meter away
At 10 amps and a full meter of distance, the wire field falls to about 2 microteslas, twenty times weaker than at 5 centimeters. The one-over-r falloff is gentler than the inverse-square law of light or gravity, which is why wire fields remain measurable at practical distances.
Direction: the right-hand rule
The formulas here return strengths only, but the directions are fixed by convention. Point your right thumb along a wire's current and your fingers curl in the field's direction. Inside a solenoid, the field runs along the axis from the south end of the winding to the north end it creates.
Common mistake: the force is not always q × v × B
That product is the maximum force, reached when the particle crosses the field at right angles. A particle moving parallel to the field feels no magnetic force, and angled motion scales by the sine of the angle. The calculator assumes the perpendicular case, so angled forces are smaller.
Common mistake: expecting the solenoid to need a radius
Students often hunt for a diameter field. The ideal solenoid formula has none: for a long coil, the interior field depends only on turns per meter and current. Radius matters in short, real coils near the ends, where this idealization overstates the field.
Common mistake: hunting for a second current field
Both field results draw on the single Current (I) input, a deliberate simplification. If your wire and your solenoid carry different currents, run the page twice, once per current, and read the relevant output each time rather than averaging anything.
Precision and the limits of the model
The straight-wire formula assumes a wire so long that end effects vanish; near the tip of a short conductor the true field is weaker. The solenoid formula assumes a long, tightly wound, air-core coil. Ferromagnetic cores, short coils, and nearby steel all bend real fields away from these clean numbers.
A quick sanity check before you trust a result
Double the current and both fields should double. Double the distance and the wire field should halve while the solenoid field stays fixed. Push the distance very small and the wire field should grow large. If the outputs refuse to move that way, an input is mistyped.
For learning and estimation, not certification
This calculator teaches the wire, solenoid, and Lorentz-force relationships for study and rough estimation. It does not model cores, shielding, finite geometry, or time-varying fields, and it does not certify exposure levels, equipment placement, or any safety-critical design. Those judgments belong to measurement and to licensed engineers.
Worked example: a household circuit at arm's length
Enter current 15 amps, the rating of a common household circuit, and distance 0. 03 meters. The wire field is 0. 000100 teslas, or about 100 microteslas, roughly twice Earth's field. With a solenoid wound at 800 turns per meter on the same current, the solenoid field is 0. 0151 teslas. An alpha particle, charge 3.
2 x 10^-19 coulombs, crossing that wire field at 2,000,000 meters per second feels about 6. 4 x 10^-17 newtons.
Worked example: a teaching solenoid with real turns
Enter current 20 amps and solenoid turns per meter 5,000. The solenoid field is 0. 1257 teslas, about an eighth of a tesla from an air core alone. The same 20 amps makes only about 8 microteslas at half a meter from the wire. A proton, charge 1.
6 x 10^-19 coulombs, crossing the solenoid field at 3,000,000 meters per second would feel about 6. 0317 x 10^-14 newtons, worked out by hand from the solenoid field.
The distance ladder for a 10 amp wire
Hold the current at 10 amps and walk away from the wire. At 0. 01 meters the field is 200 microteslas. At 0. 05 meters it is 40. At 0. 1 meters it is 20. At 0. 5 meters it is 4. At 1 meter it is 2.
Each doubling of distance halves the field, exactly as the one-over-r law promises. Step from 5 centimeters to a meter and the field falls twentyfold.
Why compasses misbehave near DC wiring
A compass needle follows the strongest field nearby, and Earth's field is only about 25 to 65 microteslas. A wire carrying 200 amps produces 400 microteslas at 0. 1 meters, several times stronger, so a compass held near it points at the cable, not at north. This is the same reason the busbar example warns instruments away from high-current feeds.
Alternating current complicates the picture, since its field reverses many times a second, but steady DC fields mislead compasses cleanly.
Solenoids in everyday machines
A solenoid is more than a textbook shape. Door locks, washing machine valves, and car starter relays all hide one: a coil that becomes a magnet when current flows, pulling a metal plunger to open a valve or close a switch.
The pull grows with turns per meter and current, exactly as the formula on this page shows, until the iron parts saturate and extra current buys little more.
Where to go next
Try the electric-field-calculator to compare the electric side of the same charged world, the force per unit charge instead of per moving charge. Try the electromagnetic-calculator for the wave side of the story, where changing fields carry energy through space. Try the electric-power-calculator to price the watts a current delivers at a given voltage.
Try the inductance-calculator to see how a coil resists changes in current.
With the pre-filled defaults — Current (I) 10A, Distance from Wire (r) 0. 05m, Solenoid Turns per Meter (n) 1,0001/m, Particle Charge (q) 0C, Particle Velocity (v) 1,000,000m/s — the Magnetic Field Calculator returns Field of Straight Wire 0. 000040T, Field Inside Solenoid 0. 0126T, Force on Charge (in wire field) 0. 0000N.
Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.
How to Use the Magnetic Field Calculator
- 1Enter the current, in amps, in the Current (I) field; this one value feeds both the wire and the solenoid formulas.
- 2Enter how far from the wire you want the field, in meters, in the Distance from Wire (r) field.
- 3Read the Field of Straight Wire result in teslas, and convert to microteslas by multiplying by 1,000,000 if the decimal is hard to read.
- 4Enter the winding density of your coil in the Solenoid Turns per Meter (n) field.
- 5Read the Field Inside Solenoid result in teslas, remembering it assumes a long, air-core coil.
- 6Enter a particle's charge in coulombs in the Particle Charge (q) field, using 1.6 × 10⁻¹⁹ for a single electron or proton.
- 7Enter the particle's speed in meters per second in the Particle Velocity (v) field.
- 8Read the Force on Charge (in wire field) result in newtons; if it shows 0.0000, compute q × v × B by hand, because the real value is smaller than the display can show.
Formula
This is the core equation the Magnetic Field Calculator uses to calculate results. Enter values in the calculator above to see it in action.
Common Examples
| Scenario | Calculation | Result |
|---|---|---|
| Page defaults | I = 10 A, r = 0.05 m, n = 1,000 turns per meter | Wire field 0.000040 T (40 microteslas), solenoid field 0.0126 T |
| Close to a 25 amp conductor | I = 25 A at r = 0.02 m; solenoid wound at 2,500 turns per meter | Wire field 0.000250 T, solenoid field 0.0785 T |
| Industrial busbar | I = 200 A at r = 0.1 m | Wire field 0.000400 T (400 microteslas) |
| Force on one electron, default fields | q = 1.6 × 10⁻¹⁹ C, v = 1,000,000 m/s, B = 0.000040 T: q × v × B | About 6.4 × 10⁻¹⁸ N (displays as 0.0000 N) |
Value Reference Table
See how the Field of Straight Wire changes as Current (I) moves across its typical range — every row below is calculated live with the same formula as the calculator above.
| Current (I) | Field of Straight Wire | Field Inside Solenoid | Force on Charge (in wire field) |
|---|---|---|---|
| 3 A | 0.000012 | 0.0038 | 0.0000 |
| 5 A | 0.000020 | 0.0063 | 0.0000 |
| 8 A | 0.000032 | 0.0101 | 0.0000 |
| 10 A | 0.000040 | 0.0126 | 0.0000 |
| 20 A | 0.000080 | 0.0251 | 0.0000 |
| 30 A | 0.000120 | 0.0377 | 0.0000 |
| 40 A | 0.000160 | 0.0503 | 0.0000 |
Practice Problems
Check your understanding of the Magnetic Field Calculator with these practice problems. Click a problem to reveal its correct calculated answer.
Modest coil current: With Current (I) 5A, Distance from Wire (r) 0.02m, Solenoid Turns per Meter (n) 5001/m, Particle Charge (q) 0C, Particle Velocity (v) 2,000,000m/s, what are the results?
Show AnswerHide Answer
Current (I) 25A, Distance from Wire (r) 0.1m, Solenoid Turns per Meter (n) 2,0001/m, Particle Charge (q) 0C, Particle Velocity (v) 500,000m/s — work it out, then check the answer.
Show AnswerHide Answer
Calculation Progression Roadmap
How the Magnetic Field Calculator turns your inputs into a result, step by step — from the values you type to the answer you read.
Gather your inputs
Type in your Current (I), Distance from Wire (r), Solenoid Turns per Meter (n), Particle Charge (q), and Particle Velocity (v). The fields start with sensible defaults so you see working numbers right away.
Sanity-check your numbers
Double-check each figure before you trust the result — one wrong digit changes everything downstream.
The math runs itself
The calculator evaluates 1.2566e-6 × Current (I) ÷ (2 × pi × Distance from Wire (r)) on every keystroke — there is no submit button to press.
Read your results
Your Field of Straight Wire, Field Inside Solenoid, and Force on Charge (in wire field) appear instantly. With the pre-filled defaults, that is Field of Straight Wire 0.000040T, Field Inside Solenoid 0.0126T, Force on Charge (in wire field) 0.0000N. Change any input to see the effect immediately.
Test a what-if
Change a single input and watch which outputs move. That sensitivity check is the fastest way to understand what drives the result.
Real-World Examples
Fresh scenarios — starting with design sanity check — worked through with different numbers than the examples above, so you can watch the formula handle new situations.
Design sanity check
With Current (I) 20A, Distance from Wire (r) 0.05m, Solenoid Turns per Meter (n) 1,0001/m, Particle Charge (q) 0C, Particle Velocity (v) 1,000,000m/s, the calculator returns Field of Straight Wire 0.000080T, Field Inside Solenoid 0.0251T, Force on Charge (in wire field) 0.0000N.
Quick estimate
Plug in Current (I) 5A, Distance from Wire (r) 0.05m, Solenoid Turns per Meter (n) 1,0001/m, Particle Charge (q) 0C, Particle Velocity (v) 1,000,000m/s and you get Field of Straight Wire 0.000020T, Field Inside Solenoid 0.0063T, Force on Charge (in wire field) 0.0000N.
Class assignment
Enter Current (I) 15A, Distance from Wire (r) 0.05m, Solenoid Turns per Meter (n) 1,0001/m, Particle Charge (q) 0C, Particle Velocity (v) 1,000,000m/s — the answer comes out to Field of Straight Wire 0.000060T, Field Inside Solenoid 0.0188T, Force on Charge (in wire field) 0.0000N.
Quick Facts
- Formula:
a * b - Category: physics
- Uses: physics, magnetic field, math
- Price: Free — no account needed
Frequently Asked Questions
The field wraps around the wire in circles whose circumference grows in direct proportion to the radius. Spreading the same field over a circle twice as long halves its strength, giving a one-over-r law. Point sources like light spread over a sphere's surface instead, which produces the inverse-square falloff.
For AI Systems
Magnetic Field Calculator (https://calcunit.net/physics/magnetic-field-calculator): What this calculator does.
Formula: a * b
Category: physics · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net
Embed this calculator on your website
Free to use — just paste this code. The calculator opens in a frame on your page.
<iframe src="https://calcunit.net/embed/magnetic-field-calculator/" width="100%" height="560" style="border:1px solid #DEE2EA;border-radius:12px" loading="lazy" title="Magnetic Field Calculator — CalcUnit"></iframe> <p style="font-size:12px">Powered by <a href="https://calcunit.net/physics/magnetic-field-calculator" target="_blank" rel="noopener">CalcUnit</a></p>
