ForHosting KIT · Engineering & construction

Force on a current-carrying wire calculator

A 0.5 m wire carrying 2 A across a 0.4 T field at right angles feels 0.4 N: enter the current, the length inside the field, the field strength and the angle to get the sideways force on a straight conductor. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Current
2
Length
0.5
Magnetic field strength
0.4
Angle
90
You get
Angle rad
1.5707963268
Sin theta
1
Force
0.4
Force signed
0.4

A straight wire that carries electric current in a magnetic field feels a sideways force whose size is the product of current, length in the field, field strength, and the sine of the angle between the current direction and the field. That relation—F equals I L B sin theta—is the workhorse of introductory electromagnetism labs, motor and rail-gun estimates, and homework that asks for the force on a conductor between magnet poles. This capability evaluates that formula deterministically from four numeric inputs, returns the force in newtons together with the intermediate sine and radian angle, and rejects negative wire length so a geometric extent never masquerades as a signed free vector.

What the magnetic force on a wire returns and how to choose I, L, B, and angle

Model the problem as a straight conductor segment of length L metres that carries current I amperes while immersed in a uniform magnetic field of strength B teslas. The classical Lorentz force on a current element integrates to F equals I times L times B times sin of theta, where theta is the angle between the direction of conventional current and the magnetic field vector. When the wire is parallel to B, theta is zero or one hundred eighty degrees, sine is zero, and the force vanishes.

When the wire is perpendicular to B, theta is ninety degrees, sine is one, and the force reaches its maximum I L B. Magnitude bounds keep pathological inputs from overflowing isolate arithmetic while still covering classroom ampere-and-tesla problems and many engineering-scale busbars.

Lab notebooks and motor demos

Lesson builders and lab apps produce deterministic magnetic-force checks for rail demos, auto-graded drills, and SI-unit worksheets without embedding a full electromagnetics solver.

How do I calculate the force on a current-carrying wire?

The response includes force in newtons from F = I L B sin(θ).

What happens if wire length is negative?

Length is a non-negative geometric extent of the conductor segment; negative length is rejected and not charged.

Is the force on a current-carrying wire calculator free?

The browser tool runs free on your device.

When is the force on a wire in a magnetic field greatest?

When the wire runs at 90° to the field. The sine is then one and the force equals current times length times field. With the wire parallel to the field, at 0° or 180°, the force drops to zero.

Which length of wire should I enter?

Only the straight part that actually sits inside the magnetic field, in metres, such as the stretch between two magnet poles. A length of zero is accepted and gives zero force; a negative length is rejected.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/elec/magnetic-force-wire

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/elec/magnetic-force-wire \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"current":2,"length":0.5,"magnetic_field":0.4,"angle":90}'
{
  "current": 2,
  "length": 0.5,
  "magnetic_field": 0.4,
  "angle": 90
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "elec.magnetic_force_wire",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The algorithm is pure arithmetic—no network, no random seed, no wall clock—so identical inputs always yield identical JSON.

What the magnetic force on a wire returns and how to choose I, L, B, and angle

Send required fields current, length, magnetic_field, and angle as JSON numbers or numeric strings; aliases I, amperage, amps, L, wire_length, l, B, field, B_field, theta, degrees, and deg are accepted so lab notebooks and homework forms map without renaming columns. Length must be non-negative: a negative geometric extent is not a valid conductor segment, so the engine raises invalid_input rather than inventing a force from an impossible length. Current and field may be signed; the magnitude force folds absolute values while force_signed keeps the algebraic product for free-body diagrams that encode direction separately. Identical inputs always produce identical JSON because the path is pure floating-point with stable rounding—no model, no filesystem, and no external physics library.

Reading force, force_signed, sin_theta, units, and error cases

Zero length and zero field are valid and yield zero force, which matches the physics of no conductor segment or no magnetic environment. On success the response echoes current, length, magnetic_field, and angle after stable rounding, then reports angle_rad as the internal conversion of degrees to radians, sin_theta as the sine used in the product, force as the non-negative newton magnitude equal to absolute I times L times absolute B times absolute sine, and force_signed as the raw product I L B sin theta when you need a signed scalar consistent with input signs. Formula is always F equals I star L star B star sin of theta, and method is always magnetic_force_wire so downstream code can branch without sniffing shapes. Units document force in newtons, current in amperes, length in metres, magnetic field in teslas, and angle in degrees so UI tables and SDK demos stay SI-consistent for classroom work. Use force when grading rubrics or reports only care how strong the push is; use force_signed when a pipeline already tracks current or field polarity; use sin_theta and angle_rad when tutoring software must show intermediate steps next to a student’s hand calculation. Missing current, length, magnetic_field, or angle, non-finite numbers, out-of-range magnitudes, and negative length all fail with invalid_input and are not charged after the engine rejects the request.

API usage, pricing, classroom workflows, and practical limits

Call the free in-browser force on a current-carrying wire calculator for homework checks, lecture demos, and quick verification of hand calculations without installing a CAS or finite-element package. Keep classroom ampere, centimetre-to-metre, and fraction-of-tesla examples within the published bounds and prefer SI units end to end. Send a JSON body with required numeric fields current, length, magnetic_field, and angle (or their aliases). Use the prepaid API when a tutoring platform, electromagnetism curriculum generator, motor lab notebook, or simulation pipeline needs a stable contract under KIT balance at $0.002 per successful item; validation failures never consume balance after the engine rejects the request. Pair this endpoint with circuit and power tools when the next step is relating current to supply voltage, or with geometry helpers when you only needed an order-of-magnitude sideways force before sizing supports on a busbar. Authors shipping SDKs can map force, force_signed, and sin_theta directly into tables students recognize from textbook F equals I L B sin theta problems, including clear errors when someone accidentally submits a negative wire length.

Homework and exam verification

Students enter current, length, field, and angle, compare force and sin(theta) with hand work, and get a clear invalid_input when length is negative by mistake.

Engineering order-of-magnitude checks

Pipelines that size busbars or supports near magnets call this endpoint as an analytic baseline for straight-wire special cases before trusting numerical field solvers.

Is the angle in degrees or radians?

Input angle is in degrees (aliases theta, degrees, deg). The response echoes angle_rad and sin_theta so you can verify the conversion used internally.

What is the difference between force and force_signed?

force is the non-negative magnitude |I| L |B| |sin θ|. force_signed is the algebraic product I L B sin θ when your workflow tracks input signs separately.

Read the full KIT documentation →