Free Math Calculator

Vector Calculator

Calculate with 2D or 3D Cartesian vectors. Add or subtract components, find magnitude and unit direction, or calculate a dot product, cross product, angle or vector projection.

✓ Free to use✓ Input-based steps✓ Calculated diagrams✓ Mobile friendly

Calculator

Enter your values

Enter your own values. The result starts blank and clears whenever an input changes.

Use finite decimals or scientific notation; enter every required component, including zero. Each component is within ±1,000,000; a nonzero magnitude is at least 10⁻¹². No fraction strings or expressions. Cross product requires 3D.

What does the 2D and 3D Vector Calculator do?

A Cartesian vector is an ordered set of components. This vector calculator supports two-component and three-component vectors on a common coordinate scale. It computes a selected operation and then draws the accepted input and result vectors as arrows from the origin.

Choose addition, subtraction, magnitude, unit vector, dot product, 3D cross product, angle between vectors or projection of A onto B. A vector result has components and can be drawn as an arrow. A scalar result, such as a dot product or magnitude, is a number and is not shown as a result arrow. For distances between points instead, use the Distance & Midpoint Calculator.

How to use the vector calculator with steps

Select 2D or 3D, select the operation, enter the required components and press Calculate. Hidden components are ignored: z is unused in 2D, and B is unused for magnitude or unit direction of A.

  1. Use one coordinate system and scale for every component.
  2. Enter zero explicitly for a required component that is zero.
  3. For cross product, select 3D and enter all six components.
  4. Read the result type, the arrows and component working.
  5. Check any zero-vector message before interpreting a direction or angle.

Inputs may be signed decimals or scientific notation. Optional graph paper (paid link) can help you sketch components and compare the result. Results and diagrams clear on edits, errors and Reset.

Affiliate disclosure: As an Amazon Associate I earn from qualifying purchases.

Vector formulas: magnitude, dot product, cross product and projection

For A = (ax, ay, az) and B = (bx, by, bz), addition and subtraction combine matching components. The magnitude is |A| = √(ax² + ay² + az²), and the unit vector is A/|A| when |A| is nonzero. Omit z terms in 2D.

The dot product is A · B = ax bx + ay by + az bz. The ordered 3D cross product is A × B = (ay bz − az by, az bx − ax bz, ax by − ay bx). Reversing the order reverses its sign. The cross product is not component-by-component multiplication.

Projection of A onto B is [(A · B)/(B · B)]B and requires nonzero B. The angle is between 0° and 180° and requires both vectors to be nonzero. The implementation uses normalized vectors and atan2 of cross magnitude and dot product for the angle, avoiding a fragile inverse-cosine value just outside [−1,1].

How to understand vector arrows and scalar answers

Gold represents A, cyan represents B and pink represents a vector result R when one exists. All visible arrows share one drawing scale and start at the origin. Addition therefore shows component locations rather than a head-to-tail construction. The exact entered component labels are listed below the plot to avoid overlapping labels.

In 2D, both axes use the same scale. In 3D, the tool uses the projection (x − 0.55z, y − 0.35z); apparent angles and lengths are foreshortened. A vector aligned with the viewing direction may collapse to a point. Use the numerical components for the answer, not a ruler measurement of the projection.

The plot fits each calculation to its box, so arrow sizes cannot be compared between separate calculations unless their scales coincide. Very small or coincident arrows may overlap. Optional rulers (paid link) can help construct a separate equal-scale paper diagram.

Worked vector examples in 2D and 3D

Let A = (3, 1) and B = (1, 2). Their sum is (4, 3), with magnitude 5. Their difference is (2, −1), and A · B = 3 × 1 + 1 × 2 = 5. Projection of A onto B is (5/5)B = (1, 2). The residual A − projection is (2, −1), whose dot product with B is zero.

For A = (1, 0, 0) and B = (0, 1, 0), A × B = (0, 0, 1), and the angle is 90°. Reversing the operands gives (0, 0, −1). If B = (−1, 0, 0) instead, the angle is 180° and the cross product is the zero vector.

Optional scientific calculators (paid link) can help check arithmetic. Use the Matrix Calculator for supported matrix operations, and the Unit Circle Calculator to connect planar directions with sine and cosine.

Accuracy, zero vectors and supported scope

Each required component must be a finite signed number within ±1,000,000. A nonzero component must have magnitude at least 10⁻¹². Decimals and scientific notation are supported; fractions, variables and typed vector expressions are not. All components use a common dimensionless coordinate scale; this tool does not convert physical units.

Browser floating-point arithmetic is used and results are approximate, displayed to up to 10 significant digits. Very different component magnitudes, cancellation and near-parallel directions can lose numerical detail. Keep the original inputs rather than repeatedly reusing rounded outputs.

Magnitude and ordinary arithmetic accept zero vectors. A zero vector has no unit direction; an angle involving zero and projection onto zero are undefined and return clear messages. Cross product is available only in 3D. This is not a symbolic vector engine, tensor calculator, physical force analysis or geographic navigation tool. Optional linear algebra workbooks (paid link) provides further practice without changing these limits.

Vector Calculator FAQs

Sources and methodology

Standard mathematical definitions independently implemented and reviewed November 3, 2026. Sources explain the mathematics; the linked organizations do not endorse this calculator.