Biot–Savart lab

Add up the magnetic field of a straight wire, a circular loop or a solenoid from small pieces of current, as the Biot–Savart law says, and compare with the exact formula. Graph the field along the axis. Then drag a loop among three long wires and see Ampère's law: the total of B round the loop is μ₀ times the current inside.

Keep it one tap away for everyday use.

Bookmark Biot–Savart lab?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Pick shape
  2. Add pieces
  3. Graph B
  4. Check
Nothing is uploadedWorks offline once open

Choose a current

Or drag the loop on the picture.

Try this

  • Straight wire: add the pieces one by one. The pieces nearest P give the most; far pieces add very little.
  • Make the wire 100 cm long with P 2 cm away: the answer is almost μ₀I/(2πd), the long-wire formula.
  • Loop: watch the sideways parts of each piece's field cancel in pairs, leaving only the part along the axis.
  • Solenoid: make it long and thin. Inside, the field is flat at μ₀nI; at each end it falls to about half.
  • Ampère's law: move the loop around wire A. The total stays at μ₀ × 5 A wherever the loop is, as long as A is inside.

Check yourself

What it does

The Biot–Savart law says that every short piece of a current-carrying wire makes a little magnetic field around it: dB = (μ₀/4π) I dl sin θ / r². To find the field of a whole wire, you add up the pieces. This page lets you do that adding, one piece at a time, for three shapes:

  • Straight wire: every piece pushes the field the same way (into the page at P), so the pieces simply add. A bar chart shows that the pieces nearest P give the most.
  • Circular loop: each piece’s field at a point on the axis is tilted. Pieces on opposite sides cancel each other’s sideways parts, leaving only the part along the axis. You see each piece’s arrow and the running total.
  • Solenoid: many loops side by side. The graph shows the field along the axis: flat at μ₀nI inside a long solenoid, falling to about half at each end.

The fourth mode is Ampère’s law. Three long wires come out of or go into the page. Drag a loop among them: the field along the loop changes, but the total ∮B·dl is always μ₀ times the current inside.

It follows the Class 12 Physics chapter on moving charges and magnetism (the Biot–Savart law, the field on the axis of a circular loop, Ampère’s circuital law, the solenoid). See the field lines with the magnetic field mapper, then use the field on a moving charge with lorentz motion or build a real coil with the electromagnet builder.

How to use it

  1. Choose Straight wire, Circular loop, Solenoid or Ampère’s law.
  2. Set the current and the sizes with the sliders. P is the point where the field is found.
  3. For the wire and loop, slide Pieces of wire added, or press Add the pieces one by one to watch the total grow.
  4. In Ampère’s law, set each wire’s current (positive is out of the page) and move the loop with the sliders or by dragging it on the picture.

Worked example

A straight wire 20 cm long carries 5 A. At P, 5 cm from the middle of the wire, sin α₁ = sin α₂ = 10/√(5² + 10²) = 0.894, so B = μ₀I/(4πd) × (0.894 + 0.894) = 10⁻⁷ × 5 / 0.05 × 1.789 = 17.9 µT, into the page. Adding the 24 pieces gives the same to within 0.02%. A very long wire would give μ₀I/(2πd) = 20.0 µT, so this short wire gives 89.4% of that.

A single loop of radius 10 cm with 5 A gives μ₀I/(2R) = 31.4 µT at its centre. A solenoid 20 cm long with 200 turns of radius 2 cm and 5 A has n = 1000 turns per metre, so μ₀nI = 6.28 mT; at its middle the field is 6.16 mT (98.1%), and at its ends 3.13 mT, about half.

In Ampère’s law, a loop round wire A (5 A out of the page) gives ∮B·dl = μ₀ × 5 = 6.28 µT m, wherever the loop sits.

Tips

  • The field of a piece falls as 1/r², so near pieces matter most.
  • Out of the page counts as positive current for a loop followed anticlockwise.
  • Ampère’s law is easiest to use where the field is the same all round the loop (a long wire, a long solenoid).

FAQ

Why is the 24-piece loop a little low? The pieces are short straight chords, so the polygon is slightly smaller than the circle. More pieces would close the gap.

Do wires outside the Ampère loop matter? They change B at every point of the loop, but their contributions add up to zero round it.

Is this an official NCERT resource? No. fibub is independent; the page follows the topics in the syllabus in its own words.

Where the numbers come from

  • Biot–Savart law dB = (μ₀/4π) I dl × r̂ / r², and its results for a straight wire of finite length, a circular loop on its axis and a solenoid on its axis (as a continuous current sheet); Ampère's circuital law ∮B·dl = μ₀ I_enclosed with the field μ₀I/(2πr) of a long straight wire: standard physics results.
  • μ₀ = 1.25663706127 × 10⁻⁶ N/A² (CODATA 2022).
  • Checked against an independent numpy Biot–Savart sum with 200 000 elements (5 A loop of radius 10 cm at 7 cm along the axis: 17.273 µT; 20 cm wire, P 5 cm away and 3 cm up: 17.471 µT into the page) and by summing the loop formula over 200 separate turns for the solenoid.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Change log for Biot–Savart lab

  1. Add #1409 Biot–Savart field builder and Ampère's law Details on GitHub

Every change to fibub

Related tools

Magnetic field mapper #L18 See the magnetic field lines of a bar magnet, a straight current-carrying wire, a circular loop and a solenoid. Drag a compass around to see which way its needle points and how strong the field is there, and learn the right-hand thumb rule. Class 12 level adds B = μ₀I/2πr, μ₀NI/2a and μ₀nI with your numbers. Faraday induction #L20 Push a bar magnet into a coil and pull it out, and watch the galvanometer swing and the emf graph. See why only a changing flux makes a current, which way the current flows (Lenz's law), and how an AC generator coil makes a sine-wave emf, with its peak and rms values. Electromagnet builder #L24 Make an electromagnet from a coil of wire, some cells and an iron nail. Change the number of turns and cells, take the nail out, switch it off or turn the cells round, and watch three compasses swing and paper clips get picked up or dropped. Lorentz motion #L262 Fire a proton, electron, alpha particle or deuteron into a magnetic field and watch it circle or spiral, with its radius, period and pitch. Add an electric field at right angles to make a velocity selector, or spin it up in a cyclotron and see its frequency, final energy and number of turns. Magnetic materials #L264 Put a diamagnetic, paramagnetic or ferromagnetic sample in a field and watch its tiny magnets: induced moments against the field, jiggling dipoles that line up a little, or whole domains that flip. Change the temperature, see Curie's law and the Curie temperature, and trace a hysteresis loop with its remanence and coercivity. Galvanometer conversion #L267 Turn a moving-coil galvanometer into an ammeter with a shunt, or into a voltmeter with a series resistance. Set the coil resistance, its full-scale current and the range you want; get the resistance with the formula and your numbers, the meter's own resistance, and a relabelled meter face that you can test.