Apps Part of Proofline

Electric & Magnetic Field Line Plotter

Field lines and equipotentials of point charges and current-carrying wires, with probe values.

“charge q x y” is a point charge q in nC at (x, y) in cm; “wire I x y” is a long straight wire carrying I amperes out of the page (negative: into the page). At most 16 lines; # starts a comment.

More options

Empty: fit the view around the sources.

One point per line: x and y in cm. The table lists E, the potential and B there (at most 20).

Try an example: · · · ·

More about this tool

How it works

Place point charges (in nC) and long straight wires (in A) in a plane and get a drawing of the electric field lines from positive to negative charges, the magnetic field loops around the wires and the equipotential lines, traced numerically from Coulomb’s law and the Biot–Savart law. The number of lines per charge follows Gauss’s law; probe points give the exact field strength, direction, potential and magnetic flux density. Part of the Proofline math notebook.

  • Electric field of point charges: E = Σ k·qᵢ·(r − rᵢ)/|r − rᵢ|³ with k = 1/(4πε₀) = 8.9875517923 × 10⁹ N·m²/C²; potential V = Σ k·qᵢ/|r − rᵢ|. Magnetic field of a long straight wire: |B| = μ₀·I/(2π·r), circling the wire anticlockwise for current out of the page (μ₀ = 1.25663706212 × 10⁻⁶ N/A²). Fields superpose.
  • Field lines start on a small circle around each positive charge, evenly spaced in angle, in a number proportional to the charge, and follow the unit field direction with fixed RK4 steps until they reach a negative charge or leave the view. Negative charges also send lines backwards; those that reach a positive charge are dropped as duplicates. Magnetic lines start at radii of equal flux steps and close on themselves.
  • Equipotentials are contour lines (marching squares) of V on a 161 × 121 grid at the potentials of a lone charge at fixed fractions of the view size, both signs, and V = 0.
  • Verified: E = kq/r² of a single charge (1 nC at 1 cm: 89 875.5 V/m), E = 2kq/(d/2)² midway in a dipole, B = μ₀I/(2πr) (1 A at 1 cm: 20 µT), radial lines of a single charge, and line counts in proportion to the charges (Gauss’s law).

An idealised 2-D picture: point charges in vacuum and infinitely long wires. The line density shows the field strength only qualitatively in a plane drawing of a 3-D field.

Sources

Part of Proofline

Related tools

Draw electric and magnetic field lines of charges and wires

Place point charges and straight currents, trace their field lines and equipotentials, and read the field strength, potential and magnetic flux density at any point.

What it is for

Field-line pictures show at a glance where a field is strong, where it points and where it vanishes. This tool draws them for point charges and for long straight wires that cross the page, and it calculates exact values at probe points you choose.

Write one source per line. charge 1 -2 0 is a 1 nC charge at x = −2 cm, y = 0. wire 5 0 3 is a long wire carrying 5 A out of the page at (0, 3 cm); a negative current flows into the page. Electric lines start on positive charges and end on negative ones. Magnetic lines are closed loops around the wires.

The field uses Coulomb's law with k = 8.9875517923 × 10⁹ N·m²/C² and the Biot–Savart result B = μ₀I/(2πr) with μ₀ from CODATA 2018. Lines are traced with fourth-order Runge–Kutta, and equipotentials come from marching squares on a fine grid. The same engine draws the field-line playground of the Proofline Sim Gallery, where you click into the picture to add sources.

Worked example

Take the electric dipole: charge 1 -2 0 and charge -1 2 0, with probe points 0 0.0001, 0 3 and 6 0.

At the midpoint the field is 44,937.8 V/m pointing from the positive towards the negative charge. That is exactly 2kq/r² with r = 2 cm. The potential there is 0 V, because the two contributions cancel. At (0, 3 cm), on the perpendicular bisector, the field is still horizontal but drops to 7669.84 V/m. At (6 cm, 0), beyond the negative charge, it points back towards it at 4212.91 V/m, and the potential is −112.344 V.

Each charge gets 8 lines per nC by default; all 8 from the positive charge are counted at the negative one.

Now try two antiparallel currents, wire 5 -2 0 and wire -5 2 0. Between them both fields point the same way, giving 100 µT at the origin (50 µT from each wire). At (0, 4 cm) they partly cancel, leaving 20 µT.

How to read the result

The picture shows electric lines in blue and magnetic loops in orange, both with direction arrows, and thin grey equipotentials. Where lines crowd together the field is strong. The Field lines per source table counts the lines that leave and arrive at each charge, and the probe table gives Ex, Ey, |E|, V and |B| in SI units.

Tips and common mistakes

  • Charges are in nanocoulombs and positions in centimetres; the results are in V/m, volts and microtesla.
  • If the charges do not add up to zero, some lines run off to infinity. The tool says so instead of bending them back.
  • A probe exactly on a source is rejected, because the field is infinite there.
  • Increase Field lines per nC (or per 2 A) for smoother pictures; the line count is proportional to the charge, as in textbook drawings.
  • Wires and charges can share one picture, but the electric and magnetic fields do not interact in this static model.

FAQ

Why does a magnetic line not close?

It left the view before returning. Widen the view with View half-height (cm), and the warning disappears.

Is the potential absolute?

Yes. It is the Coulomb potential with V = 0 at infinity, summed over all charges.

Can I model a parallel-plate capacitor?

Approximately, with two rows of equal and opposite charges. The tool has no continuous charge sheets.

Are the wires infinitely long?

Yes, each one is an ideal straight current perpendicular to the page. Short segments and loops in the page plane are not included.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://prooflinefieldlines.usefulweb.app/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://prooflinefieldlines.usefulweb.app/mcp · tool name proofline_field_lines
Example request
curl -s -X POST https://prooflinefieldlines.usefulweb.app/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{"sources":"charge 1 -2 0\ncharge -1 2 0","probes":"0 0.0001\n0 3\n6 0"}'
Feedback · ideas & bug reports welcome