Magnetic Field & Compass Simulator
Drag a bar magnet around a grid of compasses and watch the field lines turn.
Drag the magnet. Drag its glowing north tip to rotate it. Drag the big compass to probe the field.
About the Magnetic Field & Compass Simulator
Free magnetic field simulator. Drag and flip a bar magnet, see a grid of compass needles align to the field, and show field lines and strength. Built for physics, the magnetic field & compass simulator runs instantly in your browser: change a setting or drag an object and the result updates at once, so you learn by trying things out rather than only reading about them.
Drag a bar magnet around a grid of compasses and watch the field lines turn. Use it to explore physics ideas at your own pace, then check what you found against the key ideas further down this page.
How to use the Magnetic Field & Compass Simulator
- Use the controls to change Magnet strength. The simulation reacts instantly.
- Pick an option such as Field lines, Compass grid, Strength colours to switch modes or load an example.
- Press "Flip poles", "Reset" to start, reset or change what is happening.
- Where you see a glowing handle, object, weight or atom, drag it with your mouse or finger. Everything responds in real time.
- Watch the readouts and graphs update as you experiment, and compare what you see with the key ideas below.
Things to try
- Drag the magnet and watch every compass turn.
- Flip the polarity and see the field reverse.
- Rotate the magnet and compare the field lines.
- Turn field strength colours on.
Key ideas you can learn
- Magnetic field lines leave the north pole and enter the south pole.
- Compass needles line up with the local field direction.
- The field is strongest near the poles and weakens quickly with distance.
Where this is used in the real world
Magnetic fields power electric motors, generators, MRI scanners, compasses and data storage.
Who is this simulation for?
Physics students in middle school, high school and first-year university, teachers who want a quick demonstration for the projector, and anyone revising for exams. It works well for flipped classrooms because students can explore before the lesson.
For teachers: project it on the board, let students predict what will happen, then run it together. For students: change one thing at a time and write down what changes.
Frequently asked questions
Which way do magnetic field lines point?
Outside the magnet they go from the north pole to the south pole. Inside the magnet they go from south to north, so the lines form closed loops.
Why does a compass point north?
The Earth acts like a giant bar magnet, and the compass needle is a small magnet that lines up with its field.
Is the Magnetic Field & Compass Simulator free to use?
Yes. It is completely free, with no signup, no download and no ads inside the simulation. It runs in your web browser.
Does the Magnetic Field & Compass Simulator work on a phone or tablet?
Yes. It uses touch as well as the mouse, so you can drag objects with your finger. A larger screen makes the controls easier to see.