PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

More from Electricity & Magnetism

Other simulators in this category — or see all 56.

View category →
School

Electromagnetic Induction

Move magnet through coil. Faraday's law visualized.

Launch Simulator
NewSchool

Ideal Transformer

U₂/U₁ = N₂/N₁. Optional load R for I₁, I₂ (ideal power).

Launch Simulator
NewUniversity / research

Mutual Inductance

Coupled L₁, L₂ with k and M; sinusoidal primary drives secondary current through R₂.

Launch Simulator
NewUniversity / research

Mass Spectrometer (Sector)

Velocity selector v = E/B then magnetic sector: different m/q bend to different radii (2D schematic).

Launch Simulator
NewUniversity / research

Resonant Transformer (Tesla-style)

Coupled RLC tanks; tune f_drive near secondary ω₀ to grow V on high‑Q side (linear coupled ODEs).

Launch Simulator
NewSchool

Wheatstone Bridge

Four arms, G between mid nodes; V_B − V_C and null when R₁R₄ = R₂R₃.

Launch Simulator
PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Electricity & Magnetism/Magnetic Field

Magnetic Field

This simulator visualizes magnetic fields from two classroom sources: bar magnets and straight current-carrying wires. Wires make circular fields given by the right-hand rule, while magnets are drawn as dipoles with lines from north to south. Add and move sources to see superposition and how current, distance, and orientation shape B.

Who it's for: High school and introductory undergraduate physics students studying electromagnetism, particularly those learning about magnetic fields, the right-hand rule, and field superposition.

Key terms

  • Magnetic Field
  • Biot-Savart Law
  • Ampere's Law
  • Right-Hand Rule
  • Field Lines
  • Magnetic Dipole
  • Permeability of Free Space (μ₀)
  • Superposition Principle

Place on canvas

1
12
Rotate all magnets

Shortcuts

  • •Click — place magnet or wire (see mode)
  • •Drag objects to move them

Measured values

|B| at center29.2147(rel.)
Magnets1
Wires1

How it works

Magnetic dipoles are modeled as point dipoles (field ∝ 1/r³). Long straight wires produce the familiar 1/r circular field in the plane (right-hand rule). Pink arrows show the local B direction; gold curves are streamlines traced from the north side of each magnet.

Key equations

Dipole (sketch): B ∝ 3(m·r̂)r̂ − m over |r|³
Long wire: |B| ∝ |I|/r, tangent to circles (right-hand rule)

Frequently asked questions

Why are the field lines around a wire circles, but they curve between the poles of a magnet?
The geometry of the source dictates the field shape. A long, straight wire has a symmetrical cylindrical geometry, so the field lines form concentric circles around it. A bar magnet is a dipole, with a north and south pole; field lines must originate and terminate on these poles, creating the characteristic curved arcs from north to south. Both patterns are solutions to the fundamental magnetic field equations for their respective source geometries.
Can magnetic field lines ever cross?
No. At any point in space, the magnetic field has a single, unique direction and strength. If field lines crossed, it would imply two different field directions at the same point, which is physically impossible. The simulator enforces this—when you place multiple sources, the field lines adjust to form a smooth, non-intersecting pattern representing the vector sum of the individual fields.
How is the strength of the field represented in the visualization?
Field strength is represented by the density of the field lines. In regions where the lines are packed closely together (like near the poles of a magnet or very close to a current-carrying wire), the magnetic field is stronger. Where the lines are spread far apart, the field is weaker. This is a direct visual application of the convention for drawing magnetic field diagrams.
Does the simulator show the magnetic field inside the magnet?
Typically, no. This simulator, like most introductory models, visualizes the external magnetic field in the space surrounding the sources. The internal field of a bar magnet points from the south pole to the north pole, completing the magnetic circuit, but is often omitted for clarity in basic visualizations. The model focuses on the field experienced by external objects.