ForHosting KIT · Math

Vector addition calculator

Add two vectors by pairing their components: (3, 4) plus (1, -2) gives (4, 2), and (1, 2, 3) plus (4, 5, 6) gives (5, 7, 9). Both vectors must have the same number of components. 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
First text
3, 4
Second text
1, -2
You get
Sum
4, 2
Dimension
2

Empty lists, non-finite components, and dimensions above the published limit are rejected the same way.

What component-wise vector addition means

Geometrically the same operation is the parallelogram law, or the triangle law: place the tail of b at the head of a and the diagonal from the free tail to the free head is the sum. Algebra and geometry agree only when the two lists have the same length. A two-component list plus a three-component list is not defined in elementary linear algebra; inventing a missing zero would silently change the arrow and hide a shape bug in calling code.

Vector addition is commutative, so a plus b equals b plus a, and associative, so grouping three or more vectors does not change the total. The zero vector is the identity: adding it leaves every component unchanged. Those facts are why displacement stacks, force resultants, and velocity compositions can be written as one sum instead of a special-case diagram.

Teachers use the component form to check homework; graphics and physics engines use it because it is a tight loop of additions. Different dimensions are a hard error because the parallelogram is only defined when every component has a partner.

Practical tips, limits, and related searches

Keep both vectors the same length before you call; if your source data sometimes drops a trailing zero, fix the shape upstream rather than relying on silent padding. Prefer numeric arrays over pre-formatted strings when you control the client; string forms are accepted only when every token matches a strict finite numeric pattern. Near-zero floating leftovers may still land slightly off zero after rounding—if you need an exact origin for tests, use integers such as [1, minus 1] plus [minus 1, 1].

Pair classic cases when teaching: [3, 4] with [1, minus 2] for a mixed-sign two-dimensional sum; [1, 2, 3] with [4, 5, 6] for a three-dimensional textbook walk-through; [0, 0] with any partner to show the identity; and deliberately different dimensions such as [1, 2] versus [1, 2, 3] for the error path. This landing targets people searching for a vector addition calculator, add two vectors, or resultant of two component lists.

It is not a dot-product tool (which returns a scalar and an angle), not a cross-product tool (which needs three dimensions and returns a perpendicular vector), not a magnitude calculator, and not a matrix addition service. Prefer this capability when you already have numeric components and need a plus b; if your source is a word problem, extract the two coordinate lists first.

Resultant forces and displacements in pipelines

Data jobs validate equal lengths, add component lists for stacked displacements or force resultants, then pass the sum to the next stage.

What happens if the vectors have different dimensions?

Component-wise addition is only defined when both vectors share the same dimension; nothing is padded or truncated.

Is vector addition commutative?

Yes. a plus b equals b plus a for every equal-length pair, because each component is an ordinary real sum. The zero vector is the identity.

What does the vector addition calculator cost?

The browser tool is free and runs locally.

How do I add two vectors by hand?

Add the first components together, then the second ones, and so on. For (3, 4) plus (1, -2), that is 3 plus 1 and 4 plus -2, so the resultant is (4, 2).

Can I add vectors with three or more components?

Yes. Any dimension works as long as both vectors have the same length. For example, (1, 2, 3) plus (4, 5, 6) gives (5, 7, 9).

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/math/vector-addition

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/math/vector-addition \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"a":[1,2,3],"b":[4,5,6]}'
{
  "a": [
    1,
    2,
    3
  ],
  "b": [
    4,
    5,
    6
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.vector_addition",
  "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.

max_dim256
max_abs1000000000000
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.

A vector addition calculator takes two lists of components and returns the single resulting vector by adding matching coordinates: the i-th entry of the sum is a_i plus b_i. That is the component form of the parallelogram law, the same rule that adds displacements, forces, velocities, and colour offsets in physics and graphics. Enter vector a and vector b as arrays of finite numbers that share one dimension; the tool rejects mismatched lengths with invalid_input instead of padding or truncating, so a dropped coordinate cannot hide as a wrong arrow.

What component-wise vector addition means

For two real vectors a and b of the same dimension n, the sum a plus b is the unique vector whose i-th component is a_i plus b_i. In two dimensions that is the pair (a_x plus b_x, a_y plus b_y); in three dimensions you also add the z components; in n dimensions you add every paired coordinate and stop. This calculator therefore treats unequal lengths as invalid_input, not as a padded success.

How to call the API and what comes back

Each must be a non-empty array of finite numbers, or a string that parses as a bracketed or comma-or-space-separated list of finite numbers. Example: a equals [1, 2, 3] and b equals [4, 5, 6] yields sum [5, 7, 9] and dimension 3. Example: a equals [3, 4] and b equals [1, minus 2] yields sum [4, 2]. Send a JSON body with two required fields: a (aliases u, vector_a, vec1) and b (aliases v, vector_b, vec2). Dimensions must match exactly and must not exceed two hundred fifty-six components; each absolute component value must stay within one trillion so intermediate sums remain finite in IEEE double precision on the Worker and in the browser. On success the response echoes rounded a and b, sets sum to the component-wise total, dimension to the shared length, formula to the defining identity string, and steps to an ordered array of substitution lines you can show in a worksheet or assert in tests. Failed validation—missing fields, non-array input, empty vectors, different dimensions, non-finite components, values outside absolute limits, or a dimension above the published maximum—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item. Pair a deliberate mismatch such as [1, 2] versus [3, 4, 5] when you want the invalid_input path.

Practical tips, limits, and related searches

Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately send mismatched lengths. Round-trip checks are easy: recompute each a_i plus b_i by hand and confirm that dimension equals the length you sent.

Homework checks for vector geometry

Students enter two coordinate lists from textbook exercises and compare the handwritten resultant against a deterministic JSON sum before submitting.

Unit tests for physics and graphics code

Generate known-good two-dimensional and three-dimensional resultants plus deliberate dimension-mismatch rejections for expected values in engines and solvers.

How do you add two vectors by components?

For equal-length vectors a and b, the sum is the vector whose i-th entry is a_i plus b_i. Send both lists; the API returns that resulting vector as sum.

Can I add a 2D vector to a 3D vector?

No. A two-component list and a three-component list have different dimensions, so the request fails with invalid_input instead of inventing a missing zero.

Read the full KIT documentation →