Magnetic force on a current-carrying wire
A wire carrying 2 A along 0.5 m of a 0.4 T field, at 90° to it, feels a force of 0.4 N. Enter current, length, field and the angle in degrees to get the force in newtons, with its sign. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Current
- 2
- Length
- 0.5
- Magnetic field
- 0.4
- Angle
- 90
- Angle rad
- 1.5707963268
- Sin theta
- 1
- Force
- 0.4
- Force signed
- 0.4
The magnetic force on a current-carrying wire is the net Lorentz force on charges that drift through a straight conductor sitting in a magnetic field. Every introductory electromagnetism course writes the same compact identity: F equals I times L times B times the sine of the angle between the current direction and B. This calculator accepts those four finite numbers — current in amperes, wire length in metres, magnetic field strength in teslas, and the angle in degrees — converts the angle to radians internally, and returns the force in newtons.
The identity F = I L B sin(θ) and what each symbol means
A straight wire that carries current I through a uniform magnetic field B feels a force whose magnitude is F equals I L B sin(θ), where L is the length of the segment actually inside the field and θ is the angle between the conventional current direction and the field vector. When the wire is perpendicular to B, θ is ninety degrees, sine is one, and the force reaches its maximum I L B.
When the wire is parallel to B, θ is zero or one hundred eighty degrees, sine is zero, and the force vanishes — a result students often miss until they watch a current balance sit still. Current is in amperes, length in metres, field in teslas, and the returned force is in newtons, the SI combination that already includes the hidden unit identity one tesla times one ampere times one metre equals one newton.
Enter θ in degrees because that is how textbook problems and motor data sheets state it; the solver converts to radians before calling sine so you do not have to. Negative current or a reversed field flips the signed force while the reported magnitude stays non-negative, matching free-body sketches that keep a sign convention without changing the size of the arrow.
Where a magnetic-force-on-a-wire calculator earns its keep
Classrooms and tutoring platforms use a magnetic force on a current-carrying wire calculator so learners can check F equals I L B sin(θ) for arbitrary angles without a calculator-mode error on degrees versus radians. Exam generators need a deterministic oracle that rejects Infinity and the string ninety instead of silently returning NaN that a buggy grader might treat as success. Failed validation does not consume balance.
Keep requests small, pin the rounded force in tests, and you get reproducible newtons for homework, LMS plugins, and edge workers without standing up a magnetostatics solver of your own.
What you can do with it
Classroom and homework checks
Let students submit current, length, field, and angle and verify the newton force against the textbook identity F = I L B sin(θ), including the zero-force parallel-wire case.
Motor and actuator first estimates
Size a straight conductor in a known gap field before opening a finite-element model: two amperes, half a metre, 0.4 T at ninety degrees is 0.4 N.
Current-balance laboratory checks
Predict the force a current-balance should read from measured I, L, B, and θ so a teaching lab can flag a mis-set angle before blaming the magnet.
FAQ
How is the magnetic force on a current-carrying wire calculated?
Send finite numbers for current I (A), length L (m), magnetic field B (T), and the angle θ between I and B in degrees.
What angle should I enter?
Enter the angle between the conventional current direction and the magnetic field vector, in degrees. Ninety degrees is perpendicular (maximum force); zero is parallel (zero force). The solver converts degrees to radians internally.
What units does this calculator use?
SI only: current in amperes, length in metres, magnetic field in teslas, angle in degrees, force in newtons. Convert milliamps, centimetres, or gauss yourself before calling.
What happens if an input is not a finite number?
Missing values, empty strings, NaN, Infinity, and non-numeric text are all rejected and are not billed.
Which way does the force on the wire point?
It follows the right-hand rule: point your fingers along the current, curl them toward the field, and your thumb shows the force. A negative current or a reversed field flips the signed result, while the magnitude stays positive.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/phys/magnetic-force-on-current-carrying-wire \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"current":2,"length":0.5,"magnetic_field":0.4,"angle":90}'const res = await fetch("https://api.kit.forhosting.com/phys/magnetic-force-on-current-carrying-wire", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"current": 2,
"length": 0.5,
"magnetic_field": 0.4,
"angle": 90
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/phys/magnetic-force-on-current-carrying-wire",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"current": 2,
"length": 0.5,
"magnetic_field": 0.4,
"angle": 90
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/phys/magnetic-force-on-current-carrying-wire", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"current":2,"length":0.5,"magnetic_field":0.4,"angle":90}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"current":2,"length":0.5,"magnetic_field":0.4,"angle":90}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/phys/magnetic-force-on-current-carrying-wire", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"current": 2,
"length": 0.5,
"magnetic_field": 0.4,
"angle": 90
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "phys.magnetic_force_on_current_carrying_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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
If any input is missing, infinite, or not a number, the task fails with invalid_input instead of leaking NaN into a lab notebook.
The identity F = I L B sin(θ) and what each symbol means
The direction of the force follows the right-hand rule: point your fingers along I, curl them toward B, and the thumb shows F, which is why this endpoint also returns a signed product alongside the newton magnitude.
Input contract, units, response shape, and error behaviour
Example: two amperes, half a metre, four tenths of a tesla, and ninety degrees yields four tenths of a newton, because two times zero point five times zero point four times sine of ninety degrees is zero point four. Pair the numbers with your own right-hand-rule sketch if you need a picture; this calculator returns the force, not a plot. POST a JSON body with four required finite numbers: current in amperes (aliases I, amperage, amps), length in metres (aliases L, wire_length, l), magnetic_field in teslas (aliases B, field, field_strength, magnetic_field_strength), and angle in degrees (aliases theta, degrees, deg). Each field may arrive as a JSON number or as a numeric string; missing fields, empty strings, NaN, Infinity, and non-numeric text all fail with invalid_input naming the field, and those failures are not billed. Convert your own milliamps, centimetres, or gauss before you call — this endpoint does not guess unit prefixes. On success the body echoes the four inputs, the angle in radians, sin_theta, force as the non-negative magnitude in newtons, force_signed as the raw product I L B sin(θ), the formula string F=I*L*B*sin(theta), and a units object.
Where a magnetic-force-on-a-wire calculator earns its keep
Motor, loudspeaker, and rail-gun sketches start from the same four numbers when a designer sizes a conductor in a known gap field; calling a tiny parse API avoids pulling a finite-element package for a straight-wire estimate. Teaching-lab current-balance experiments measure force to infer B, and the inverse check — given I, L, B, and θ, what force should the balance read — is exactly this endpoint.
Technical questions
What does the magnetic force on a current-carrying wire calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.