ForHosting KIT · Engineering & construction

Coulomb's law calculator

Charges of 2 µC and -3 µC held 0.05 m apart attract each other with about twenty-one and a half newtons. Enter both charges in coulombs and the distance in metres to get the signed force, its size and whether they attract or repel. 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
Q1
0.000002
Q2
-0.000003
Distance
0.05
You get
Force
-21.5701243015
Force magnitude
21.5701243015
Interaction
attractive
K
8,987,551,792.3

Coulomb's law is the foundational rule of electrostatics: two stationary point charges attract or repel with a force proportional to the product of the charges and inversely proportional to the square of the distance between them. Students, lab teams, and simulation pipelines use that relation constantly when checking homework, sizing insulated gaps, or sanity-checking finite-element outputs against a simple analytic baseline. This capability evaluates F equals k times q1 times q2 over r squared with a fixed Coulomb constant, returns the signed force in newtons together with magnitude and interaction type, and rejects zero separation so the singular one-over-r-squared case never masquerades as a finite answer.

What Coulomb's law returns and how to choose q1, q2, and distance

Model the problem as two point charges q1 and q2 measured in coulombs, separated by a distance r measured in metres in vacuum. The classical Coulomb formula states that the force along the line joining the charges is F equals k times q1 times q2 divided by r squared, where k is approximately nine times ten to the nine newton metre squared per coulomb squared. When the product q1 times q2 is positive, like charges repel and this calculator reports a positive signed force with interaction set to repulsive.

When the product is negative, opposite charges attract and the signed force is negative with interaction attractive. When either charge is zero the force is zero and interaction is none. Magnitude bounds keep pathological inputs from overflowing isolate arithmetic while still covering classroom microcoulomb problems and many engineering gap checks.

Lab notebooks and curriculum tools

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

Is the Coulomb's law calculator free?

The browser tool runs free on your device.

Which units and constant does the calculator use?

SI units: charges in coulombs, distance in metres, force in newtons. The Coulomb constant k is fixed at 8.9875517923e9 N·m²/C² for deterministic results.

What happens if the distance is zero?

The calculation is refused. Two point charges in the same place would make the force grow without limit, so instead of inventing an infinite answer the calculator asks for a distance other than zero.

How do I know whether the charges attract or repel?

Look at the sign. Like charges give a positive force and are labelled repulsive; opposite charges give a negative force and are labelled attractive. If either charge is zero, the force is zero.

What happens to the force if I double the distance?

It drops to a quarter. The force falls with the square of the distance, so twice as far means four times weaker, and three times as far means nine times weaker.

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/coulombs-law

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/coulombs-law \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"q1":0.000002,"q2":-0.000003,"distance":0.05}'
{
  "q1": 0.000002,
  "q2": -0.000003,
  "distance": 0.05
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "elec.coulombs_law",
  "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 Coulomb's law returns and how to choose q1, q2, and distance

Send required fields q1, q2, and distance as JSON numbers or numeric strings; aliases charge1, Q1, charge2, Q2, r, separation, and d are accepted so homework forms and lab notebooks map without renaming columns. Distance must be non-zero: placing two point charges at the same location makes the inverse-square term diverge, so the engine raises invalid_input rather than inventing infinity. Identical inputs always produce identical JSON because the path is pure floating-point with a fixed constant and stable rounding—no model, no filesystem, and no external physics library.

Reading force, magnitude, interaction, units, and error cases

The field k is the exact Coulomb constant used in the computation so reports and graded rubrics can cite it without ambiguity. On success the response echoes q1, q2, and distance after stable rounding, then reports force as the signed newton value from F equals k q1 q2 over r squared, force_magnitude as the absolute value for display when you only need how strong the push or pull is, and interaction as repulsive, attractive, or none. Formula is always F equals k star q1 star q2 over r caret two, and method is always coulombs_law so downstream code can branch without sniffing shapes. Units document force in newtons, charge in coulombs, and distance in metres so UI tables and SDK demos stay SI-consistent. Use signed force when free-body diagrams need direction along the joining line; use force_magnitude when comparing strength only; use interaction when a human-readable label is enough. Missing q1, q2, or distance, non-finite numbers, out-of-range magnitudes, and zero distance 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 Coulomb's law calculator for homework checks, lecture demos, and quick verification of hand calculations without installing a CAS or finite-element package. Charge and distance magnitudes grow in product over r squared, so keep classroom microcoulomb and centimetre-scale examples within the published bounds and prefer SI units end to end. Send a JSON body with required numeric fields q1, q2, and distance (or their aliases). Use the prepaid API when a tutoring platform, electronics curriculum generator, electrostatics 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 voltage-and-field tools when the next step is relating force on a test charge to electric field, or with circuit calculators when you only needed an order-of-magnitude repulsion check before laying out conductors. Authors shipping SDKs can map force, force_magnitude, and interaction directly into tables students recognize from textbook Coulomb problems, including clear errors when someone accidentally submits zero separation.

Homework and exam verification

Students enter two charges and a separation, compare signed force and magnitude with hand work, and get a clear invalid_input when distance is zero by mistake.

Simulation sanity checks

Pipelines that mesh continuous charge distributions call this endpoint as an analytic baseline for two-point special cases before trusting numerical force fields.

How do I compute the electrostatic force with this calculator?

Send JSON with q1, q2 (coulombs) and distance (metres). The response includes signed force, force_magnitude, interaction (repulsive/attractive/none), and the Coulomb constant k used.

What happens if the distance is zero?

The request fails with invalid_input. Zero separation makes Coulomb's law singular (division by r squared); the engine rejects that case and does not charge the call.

Is the force positive or negative?

Signed force follows F = k q1 q2 / r^2: same-sign charges give a positive (repulsive) value; opposite signs give a negative (attractive) value. force_magnitude is always non-negative.

Read the full KIT documentation →