Magnetic Field Lines
Draw the magnetic field lines around bar magnets, a horseshoe magnet or a set of magnets, and print them as a poster or a worksheet. The tool uses a simple idealised model: each end of a magnet is a point pole, N or S, and the field at any point is the sum of the poles’ fields, each falling off with the square of the distance. Every line is traced step by step along the field from the N poles, with arrows from N to S, and stops where it reaches an S pole, a magnet or the edge of the page; lines that come in from the edge to an S pole are traced too. Show the lines, an iron-filings look, compass needles on a grid, or just the magnets for students to draw their own. Magnets print at the size you type. Download a PDF, a 300 DPI PNG or an SVG. Nothing is uploaded.
100% private — everything runs in your browser. Everything runs in your browser; nothing is uploaded.
Print at 100% (Actual size): magnets print at the size you type and the field fills the page. The SVG holds every field line as a path.
Magnets
Look
Page
Runs in your browser with our own code: nothing you type is uploaded or saved. Every line, filing and needle is worked out from the pole model by our own code. You may use what you make here, including commercially, with no credit needed.
How to draw and print magnetic field lines
- Pick a preset, or choose an arrangement of magnets.
- Type the magnet length, width and gap, and turn the set if you like.
- Choose field lines, filings, both, compass needles or magnets only.
- Set the number of lines per pole and the colours.
- Download the PDF and print at 100% (Actual size), or the PNG or SVG.
What you can use it for
- Science worksheets: draw the field around a magnet
- Answer sheets and posters for magnetism lessons
- Comparing attracting and repelling magnets
- Diagrams for notes, slides and revision cards
- Plotter and laser art from the SVG lines
- Pattern ideas from the flowing lines
The 17 presets
| Preset | Magnet | Gap | Look | Lines drawn | Lines ending at an S pole or magnet | Lines reaching the page edge |
|---|---|---|---|---|---|---|
| One bar magnet: field lines with arrows | 60 × 16 mm | 30 mm | field lines | 26 | 6 | 20 |
| One bar magnet: 32 lines per pole | 60 × 16 mm | 30 mm | field lines | 54 | 10 | 44 |
| One bar magnet: iron-filings look | 60 × 16 mm | 30 mm | iron-filings look (1,800) | – | – | – |
| One bar magnet: compass needles | 60 × 16 mm | 30 mm | compass needles (404) | – | – | – |
| Two bars attracting (N facing S) | 60 × 16 mm | 30 mm | field lines | 46 | 18 | 28 |
| Two bars repelling (N facing N) | 60 × 16 mm | 30 mm | field lines | 52 | 12 | 40 |
| Two bars repelling: iron-filings look | 60 × 16 mm | 30 mm | iron-filings look (1,800) | – | – | – |
| Two bars side by side, same way | 60 × 16 mm | 40 mm | field lines | 58 | 6 | 52 |
| Two bars side by side, opposite ways | 60 × 16 mm | 30 mm | field lines | 44 | 20 | 24 |
| Horseshoe magnet | 70 × 16 mm | 30 mm | field lines | 23 | 9 | 14 |
| Horseshoe magnet: lines and filings | 70 × 16 mm | 30 mm | lines + filings (1,800) | 23 | 9 | 14 |
| Four bars around a square (quadrupole) | 40 × 12 mm | 50 mm | field lines | 80 | 48 | 32 |
| Three bars in a row | 40 × 16 mm | 16 mm | field lines | 46 | 26 | 20 |
| Two bars in a T | 50 × 16 mm | 10 mm | field lines | 41 | 14 | 27 |
| Short bar inside a circle (planet-style picture) | 80 × 16 mm | 30 mm | field lines | 28 | 12 | 16 |
| Worksheet: one bar and compass needles, no lines | 60 × 16 mm | 30 mm | compass needles (150) | – | – | – |
| Worksheet: two bars only (draw the lines yourself) | 60 × 16 mm | 30 mm | magnets only | – | – | – |
Line counts are worked out by the tool from the lines it traces, on US Letter.
One bar magnet: lines per pole
| Lines per N pole | Lines drawn | N pole to S pole | N pole to the page edge | Page edge to S pole |
|---|---|---|---|---|
| 4 | 6 | 2 | 2 | 2 |
| 8 | 14 | 2 | 6 | 6 |
| 12 | 20 | 4 | 8 | 8 |
| 16 | 26 | 6 | 10 | 10 |
| 24 | 40 | 8 | 16 | 16 |
| 32 | 54 | 10 | 22 | 22 |
| 48 | 80 | 16 | 32 | 32 |
Lines from the N pole spread over the half facing out of the magnet; the outer ones leave the page, and the same number come back in to the S pole from the edge.
How the model works
| Part | In this tool |
|---|---|
| Poles | One point pole at the middle of each end face: N = +1, S = −1 |
| Field | Sum over the poles of (r − rᵢ) / |r − rᵢ|³, so each pole’s field falls off with the distance squared |
| Tracing | Fourth-order Runge–Kutta steps of 0.4 mm along the field direction, from 1.5 mm out of each N pole |
| A line stops | Within 1.5 mm of an S pole, at a magnet’s outline, at the page edge, or where the field is zero |
| Not modelled | The inside of a magnet, its material, field strength in tesla |
What prints
| Download | What is in it |
|---|---|
| The field filling the page, magnets at the size you type, vector, with the settings and a check bar | |
| PNG 300 DPI | The same sheet as a picture |
| SVG | Every field line, filing and needle as a path, and the magnets, at the printed size |
For a cutter that needs DXF, use SVG to DXF.
Which tool to use
| You want | Use |
|---|---|
| Field lines around magnets, a filings look or a worksheet | Magnetic Field Lines (this page) |
| A grid to draw your own diagram on | Graph Paper |
| To edit the lines by hand | SVG Path Editor |
Other tools: Graph Paper prints grids, and the SVG Path Editor edits any line from the SVG.
More free tools
Curves, patterns and printables?
Drawing and print tools that run privately in your browser, with no sign-up and no watermark.
Frequently asked questions
What are magnetic field lines?
They are drawn lines that show which way a magnetic field points: at every point a line runs along the field, the way a small compass needle would point. Compass needles point away from a magnet’s north pole and towards its south pole, so outside a magnet the lines run from N to S. The lines are a way to draw the field; the field itself has no separate lines.
How does the tool draw them?
Each magnet end is a point pole of strength +1 (N) or −1 (S). The field at a point is the sum over all poles of the direction away from the pole divided by the distance squared. Each line starts 1.5 mm from an N pole and is traced in 0.4 mm steps with the fourth-order Runge–Kutta method along the field direction. In our tests every step is within 0.01 radian of the field direction, and for one bar magnet the lines match the exact two-pole solution to one part in a million.
Why do the lines never cross?
At any point the field has only one direction, so two lines can only meet where the field is zero or at a pole. Our tests check every pair of lines on every preset for crossings away from the poles and find none.
What happens inside the magnet?
Magnetic field lines have no ends: they form closed loops, so each line that reaches an S pole carries on through the magnet. The pole model on this page does not describe the inside of a magnet, so nothing is drawn there; each line stops at the outline.
Is it what iron filings really show?
Iron filings line up with the field, which is what the filings look draws: short dashes turned along the field at scattered points. Real filings also bunch into separate strands, because the iron itself changes the field around it, so a photo looks streakier than this even scatter.
Is this a measurement of a real magnet?
No. It is an idealised model for drawing and teaching. A real magnet’s field depends on its material, shape and how it was magnetised, so its lines can sit in different places. The tool does not work out a field strength in tesla.
What do the compass needles show?
Each needle is turned along the field at its point on an even grid, with the red tip pointing the way the field points, the way a small compass would settle near the magnets.
Is it free?
Yes. There is no sign-up, no watermark and no limit.
Is anything uploaded?
No. Every point, line and filing is worked out by JavaScript in your browser. Nothing you type is sent anywhere or saved when you close the page.