Zero Signup ToolsFree browser tools

Calculator Tools

Vector Calculator

Calculate magnitude, dot product, cross product, angle, projection, and cosine similarity for 2D and 3D vectors in your browser.

Vector dimension

Pick 2D for (x, y) plane vectors or 3D for (x, y, z) space vectors.

Operation

Scalar product: sum of products of matching components.

Vectors

Vector a
Vector b

Example presets

How to use

  1. Pick a dimension at the top: 2D for (x, y) plane vectors or 3D for (x, y, z) space vectors. Cross product is only available in 3D.
  2. Choose an operation: magnitude, unit vector, scalar multiply, negate, add, subtract, dot product, cross product, angle between, cosine similarity, vector projection, scalar projection, or distance.
  3. Enter the components of vector a in the fields, or paste them as a single string in any common shape (1, 2, 3 or 1 2 3 or [1, 2, 3]) and click Use a.
  4. If the operation needs a second vector, enter or paste vector b too. For scalar multiply, enter a real number for the scalar k.
  5. Read the headline answer, the step-by-step breakdown with all intermediate values, and the substituted formula. Use the Copy buttons to grab any single value, the formula, or the whole summary.
  6. Load a preset (magnitude of (3, 4, 12), unit vector of (3, 4), dot product (1, 2, 3) . (4, -5, 6), and others) to see a worked example, or click Swap a and b to flip the order.

About this tool

Vector Calculator performs every common operation on 2D and 3D vectors in one place: magnitude (length), unit vector (normalize), scalar multiplication, negation, addition, subtraction, dot product, cross product (3D only), angle between two vectors in degrees and radians, cosine similarity in the standard -1 to 1 range, vector projection of one vector onto another, scalar projection (the signed length of that projection), and Euclidean distance between two vectors. The dimension toggle switches every input and operation between 2D (x, y) and 3D (x, y, z) so you do not have to maintain two separate calculators for plane and space work. Components can be entered field by field or pasted in any common shape (comma-separated like 1, 2, 3; space-separated like 1 2 3; or bracketed like [1, 2, 3], (1, 2, 3), or <1, 2, 3>), with European comma decimals automatically detected when there is no ambiguity. Every result panel shows the headline answer, a full step-by-step breakdown with the intermediate values (squared components, dot product, magnitudes, intermediate scalars, projection coefficient, and so on), and the exact substituted formula in the standard mathematical notation a textbook uses, with copy buttons on every value so you can paste straight into homework, a notebook, a code comment, or a documentation page. Edge cases that students and engineers actually hit are handled explicitly: cross product is hidden in 2D mode and surfaces a friendly message if requested for non-3D inputs, the zero vector is detected before angle, cosine similarity, projection, scalar projection, and unit vector are evaluated (since those operations are undefined when a magnitude is zero), and floating-point drift in arccos is clamped to the valid -1 to 1 domain so a value like 1.0000000001 cannot return NaN. Useful for high school and university math homework (vectors unit, linear algebra 101, dot and cross products, vector projections), physics problems (force decomposition, work as a dot product, torque as a cross product, displacement and velocity vectors), engineering (statics and dynamics, mechanical and electrical vector quantities), 3D graphics and game development (normalize a direction, find the angle between a camera and a target, project a velocity onto a surface normal, compute a perpendicular axis), and machine learning (cosine similarity between feature vectors and embeddings). All math runs in your browser using native JavaScript Math; the vectors and scalars you enter here are never uploaded, never logged, and never persisted off-device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsCalculator Tools