Skip to content
Magnetism · Physics

Magnets & Electromagnets Simulation

Drag a compass around a bar magnet and map its field. Then build an electromagnet from a battery and a coil and see how loops, current and AC change it.

Interactive virtual lab · no download · works on phones and laptops

Chapter
Magnetism and Matter · Moving Charges
For
Class 10 · Class 12
Time
~12 min

Magnets & Electromagnets is a Pro simulation

Pro opens all 125 virtual labs — 483 simulations with guides and quizzes.

How to use it

  1. 1Drag the magnet or the compass.
  2. 2Turn on the field grid and the field meter.
  3. 3Electromagnet: change loops and battery voltage, or switch to AC.
  4. 4Flip the magnet's polarity.

What to notice

  • Field lines leave the north pole and enter the south pole.
  • The field weakens quickly with distance — roughly 1/r³ far from the magnet.
  • An electromagnet's field grows with turns and current: B ∝ nI.
  • Reversing the current reverses the poles; AC makes them flip continuously.

For teachers

A ready-made teaching kit comes with this lab

  • Lesson plan

    20 min, 4 steps

  • Ask the class

    3 questions with answers

  • Quick quiz

    6 questions, printable

  • Key formulas

    2 formulas

About the Magnets & Electromagnets simulation

A bar magnet's field runs out of its north pole and round into its south pole, and inside the magnet it runs back from S to N, so the lines are closed loops. A current in a coil makes the same kind of field: an electromagnet, which you can switch off, reverse, or make stronger with more turns and more current.

In this magnets and electromagnets simulation you drag a bar magnet, a compass and a field meter, show field lines and the field inside the magnet, add Earth's field, then switch to an electromagnet powered by DC or AC. It covers Magnetic Effects of Electric Current in Class 10 and Moving Charges and Magnetism and Magnetism and Matter in Class 12.

Also covers: bar magnet, compass, magnetic field lines, solenoid, electromagnet, earth's magnetic field.

Frequently asked questions

How do you make an electromagnet stronger?

Use more turns, more current, or an iron core.

What happens to an electromagnet's poles when the current reverses?

They swap: north becomes south.

How quickly does a magnet's field fall off with distance?

Far from it, roughly as 1/r³: twice as far gives about an eighth of the field.