All Over Tools logo
Tool Combiner
Analyze Tools Clean Tools Compare Tools Convert Tools Data Validation Extract Tools Format Tools Generate Tools Organize Tools Transform Tools
Image Tools Video Tools Audio Tools Subtitle Tools Font Tools
Analyze Tools Clean Tools Compress Tools Convert Tools Edit Tools Extract Tools Generate Tools Merge Tools Organize Tools Redact Tools Repair Tools Split Tools
Analyze Tools Clean Tools Compare Tools Convert Tools Extract Tools Generate Tools Merge Tools Transform Tools Validate Tools
Business Calculators Construction Calculators Date And Time Calculators Education Calculators Financial Calculators Food Calculators Health Calculators Math Calculators Science Calculators Sports Calculators Statistics Calculators
Blog About Us Contact Us

Vector Calculator

Calculate magnitude, unit vector, addition, subtraction, scalar multiplication, dot product, cross product, angle between vectors, and projection - for 2D and 3D vectors, with formulas and exact values shown at every step.

Each component accepts a plain number (e.g. -3, 2.5) or a simple fraction (e.g. 3/4).

A B A + B
Vector addition: A + B by placing B's tail at A's tip.
A B proj_B(A)
Projection: proj_B(A) is the shadow A casts onto the line of B.

Choose an operation, dimension, and inputs

Start by selecting one of the seven modes: Magnitude & Unit Vector, Add / Subtract, Scalar Multiply, Dot Product, Cross Product, Angle Between, or Projection. Then choose 2D ⟨x, y⟩ or 3D ⟨x, y, z⟩.

Enter the components for Vector A. Vector B appears only for operations that need a second vector. Scalar k appears only for Scalar Multiply. Components accept plain numbers or simple fractions such as -3, 2.5, and 3/4. For Add / Subtract, also choose A + B or A − B.

Calculate and manage the result

Click Calculate to validate the fields. A successful calculation reveals the result, formulas, and steps for the selected mode. The result stays hidden when validation fails.

  • Copy result copies the plain-text report. If clipboard access fails, the tool shows Copy failed.
  • Download result (.txt) downloads the report as the plain-text file vector-result.txt.
  • Reset clears the vector and scalar fields, hides errors, and hides the result. It does not restore the example values.

What each operation returns

  • Magnitude & Unit Vector returns the magnitude, a decimal unit-vector approximation, and direction cosines with axis angles. It rejects a zero Vector A because a unit vector cannot be defined from it.
  • Add / Subtract performs component-wise addition or subtraction using the selected A + B or A − B control.
  • Scalar Multiply multiplies Vector A by Scalar k and reports the resulting magnitude.
  • Dot Product returns the exact scalar product and an angle when both vectors are nonzero. A zero dot product is identified as orthogonal only when both vectors are nonzero.
  • Cross Product returns a 3D vector in 3D. In 2D it returns the signed scalar z-component; its absolute value is the parallelogram area and its sign indicates orientation. In 3D, the cross-product magnitude is shown only when both inputs are nonzero.
  • Angle Between returns degrees and radians and rejects either zero vector.
  • Projection returns the vector projection, scalar projection, and perpendicular component. It rejects a zero Vector B.

2D and 3D scope

One dimension control applies to every vector field, so Vector A and Vector B always use matching dimensions. The tool supports 2D and 3D vectors only. It does not support dimensions beyond 3D, symbolic algebra, or physics simulation involving forces, velocity, time, or motion.

Exact values, decimals, and validation

Parsed fractions and supported component-wise arithmetic, scalar multiples, dot products, and cross products remain exact. Magnitude, unit-vector values, direction-cosine values, and angles are displayed as decimals; the unit vector is not shown as an exact unit-vector expression.

To fix a rejected calculation, fill every component, use a valid number or fraction, and avoid a zero denominator. A zero vector is not accepted where a direction is required: unit-vector mode rejects zero Vector A, Angle Between rejects either zero vector, and Projection rejects zero Vector B.

Privacy and local processing

The vector calculator script parses and calculates values in the browser and contains no submission of entered vector values. The page also imports external analytics and CDN resources, so this does not mean that the page makes no external requests.

How to use the Vector Calculator

  1. Select an operation.
  2. Select 2D ⟨x, y⟩ or 3D ⟨x, y, z⟩.
  3. Enter Vector A and, when shown, Vector B or Scalar k.
  4. For Add / Subtract, select A + B or A − B.
  5. Click Calculate.
  6. After a successful result, use Copy result or Download result (.txt).

Frequently Asked Questions

What vector operations does this calculator support?

It supports Magnitude & Unit Vector, Add / Subtract, Scalar Multiply, Dot Product, Cross Product, Angle Between, and Projection for 2D or 3D vectors.

Does it support both 2D and 3D vectors?

Yes. Select 2D ⟨x, y⟩ or 3D ⟨x, y, z⟩. The same selection controls every vector field, so A and B always have matching dimensions.

How does cross product work in 2D?

In 2D, Cross Product returns the signed scalar z-component of the equivalent 3D cross product, ax*by − ay*bx. Its absolute value equals the parallelogram area, and its sign indicates orientation; it is not a vector result.

What happens with a zero vector?

A zero vector has no direction. Magnitude & Unit Vector rejects a zero Vector A, Angle Between rejects either zero vector, and Projection rejects a zero Vector B. Dot Product still returns zero, and Cross Product still returns the zero result. Dot-mode orthogonality is reported only for nonzero vectors.

Are results exact or rounded?

Parsed fractions and supported component-wise arithmetic, scalar multiples, dot products, and cross products remain exact. Magnitudes, unit-vector values, direction-cosine values, and angles are displayed as decimals, and the unit vector is shown as a decimal approximation.

Related Tools

4 views