Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Vectors Calculator

How to use Vectors Calculator
  1. Pick a card on the first screen, Single Vector, Two Vectors or Multiple Vectors, then an operation in the Category column on the left. Learn more about choosing an operation
  2. Set Dimensions (2 to 10); every vector takes that many components, and the cross product needs exactly 3. Learn more about the dimension
  3. Type the components of Vector A (and Vector B), or use Random and Clear; in Multiple Vectors, + Add Vector adds a card, and Linear Combination and Span Check show extra boxes for coefficients or a target. Learn more about entering vectors
  4. Click Execute Operation; a red box lists any problem, otherwise the Result box shows a number, a vector, TRUE or FALSE, or a matrix. Reset All returns to the first screen. Learn more about the result
  5. Read the panel on the right: the operation's description, the Calculation Steps after an Execute, and the History of this visit. Learn more about the panel

Professional vector operations calculator

Select Operation Type








Choosing a Category and an Operation

DemoA category, an operation, another category
Step 0 of 3
The calculator opens on Select Operation Type with three cards: Single Vector (magnitude, unit vector, normalization), Two Vectors (add, subtract, dot and cross product) and Multiple Vectors (linear combinations, spans, independence). Clicking a card moves to the input screen, with the Category list and the operations of the chosen category on the left, the Vector Input card in the middle and the explanation panel on the right. One vector is created for the single category, two for the other two, all with the current number of dimensions.

Click an operation to select it: a dot marks it, the panel heading takes its name and any earlier result is cleared. Click another category in the same column to switch; the operation list changes and the vectors are rebuilt, so typed components are lost. Reset All at the top right returns to the first screen with three dimensions. The three categories are described in Single-Vector Operations, Two-Vector Operations and Multiple-Vector Operations.

Setting the Dimension

DemoTwo dimensions, a cross product refused, Reset All
Step 0 of 3
The Dimensions box above the vectors sets how many components every vector has, from 22 to 1010; the page opens with 33. Changing it rebuilds every vector at once with empty components, and a value outside the range is refused with "Dimensionality must be between 2 and 10" while the vectors are left as they were. Every vector of a category shares the dimension, which is what the two-vector and multiple-vector operations require.

Two operations care about the number itself: the Cross Product is defined only in three dimensions, and Execute answers "Cross product is only defined for 3D vectors" otherwise, and the Matrix Form builds a matrix with as many rows as dimensions and as many columns as vectors. Why the cross product is a three-dimensional operation is explained in Cross Product.

Entering the Vectors

DemoTyping two vectors, Random, Clear, then a third vector
Step 0 of 4
Each vector is a card headed Vector A, Vector B and so on with one number box per component; type decimals or negative numbers and move on with Tab. Random fills the vector with whole numbers from −10-10 to 1010 and Clear empties it; each vector has its own pair of buttons. In the Multiple Vectors category, + Add Vector appends another card, up to ten, and a Remove button on each card beyond the second takes it away.

Two operations ask for more. Linear Combination shows a Coefficients (one per vector) row under the cards, one box per vector, and Span Check shows a Target Vector row with one box per component. An empty or non-numeric component is reported at Execute time as "Vector A has empty components" or "Vector A contains invalid numbers", a missing coefficient as "All coefficients must be valid numbers", and a missing target as "Target vector has empty components". The components are the coordinates described in Sum of Components.

Calculating and Reading the Result

DemoA magnitude, a dot product, a cross product
Step 0 of 3
Click Execute Operation under the vectors; the button is grey until an operation is selected. The calculator first checks the input and lists every problem in a red box; when the input passes, the button reads "Calculating..." for a moment and the Result box fills. The shape of the answer follows the operation: a number with its name for the magnitude, the norms, the dot product, the angle and the distance, for example 55 for the magnitude of (3,4,0)(3, 4, 0) and 3232 for (1,2,3)⋅(4,5,6)(1, 2, 3) \cdot (4, 5, 6); a vector for addition, subtraction, the cross product, the unit vector, projections and linear combinations, such as (−3,6,−3)(-3, 6, -3) for the cross product above; TRUE or FALSE with a note for the span, independence and orthogonality checks; and a matrix for the Gram-Schmidt process and the matrix form.

Decimals are shown rounded. Reset All clears everything and returns to the first screen. The operations behind the results are explained from Vector Magnitude on.

The Explanation Panel, Steps and History

DemoThe panel text, the steps, the history
Step 0 of 3
The panel on the right of the input card carries the heading of the selected operation and a short text on what it computes, with a link to the section of this page that explains it; before an operation is chosen it describes the category. After a successful Execute, Calculation Steps appears under the text with the arithmetic for your numbers, such as the three products of a dot product or the component differences of a subtraction, and a History accordion lists every computation of this visit with its time, inputs and result; Clear history empties it.

The panel changes as soon as you click another operation, and the steps disappear until the next Execute, so the text always matches the selected operation. Reset All clears the steps but not the history. The operations the panel describes are grouped in Single-Vector Operations, Two-Vector Operations and Multiple-Vector Operations.

Single-Vector Operations

The Single Vector category works on one vector a\mathbf{a} and offers seven operations: Vector Magnitude, Unit Vector, Vector Normalization, Sum of Components, the L1 Norm, the L2 Norm and the Infinity Norm. All work in any dimension from 22 to 1010.

Most of them are ways of measuring length. For u=(3,4,0)\mathbf{u} = (3, 4, 0) the magnitude, which is the L2 norm, is 55; the L1 norm adds the absolute components, 77; the infinity norm takes the largest, 44; the unit vector divides by the magnitude, (0.6,0.8,0)(0.6, 0.8, 0), which is what Normalize does too; and the sum of components is 77. The lesson introduces these measures in Magnitude and the norm.

Vector Magnitude

The magnitude (or length) of a vector v=(v1,v2,…,vn)\mathbf{v} = (v_1, v_2, \ldots, v_n) measures its distance from the origin:

∣∣v∣∣=v12+v22+⋯+vn2||\mathbf{v}|| = \sqrt{v_1^2 + v_2^2 + \cdots + v_n^2}


The magnitude is always non-negative and equals zero only for the zero vector. It is also called the Euclidean norm or L2 norm. In physics, the magnitude of a velocity vector gives speed, and the magnitude of a force vector gives the force strength.

See Magnitude in two and three dimensions and The general norm.

Unit Vector

A unit vector has magnitude 1 and indicates direction only. Given a nonzero vector v\mathbf{v}, the corresponding unit vector is:

v^=v∣∣v∣∣\hat{\mathbf{v}} = \frac{\mathbf{v}}{||\mathbf{v}||}


The standard basis vectors e1,e2,…,en\mathbf{e}_1, \mathbf{e}_2, \ldots, \mathbf{e}_n are unit vectors pointing along each coordinate axis. Unit vectors are essential in defining directions for projections, constructing orthonormal bases, and representing orientations in physics and computer graphics.

See Unit vectors in the magnitude lesson.

Vector Normalization

Normalization is the process of converting a vector to a unit vector by dividing each component by the magnitude. The result preserves direction while setting the length to 1.

Normalization is undefined for the zero vector since division by zero is not possible. It is widely used in machine learning (feature normalization), computer graphics (surface normals), and physics (direction vectors). Normalized vectors simplify many formulas because ∣∣v^∣∣=1||\hat{\mathbf{v}}|| = 1 eliminates magnitude terms.

See Normalization and Unit vectors.

Sum of Components

The sum of components adds all entries of a vector:

S=v1+v2+⋯+vnS = v_1 + v_2 + \cdots + v_n


This operation is useful for checking whether a vector sums to zero (important in certain probability and physics contexts), computing averages when divided by nn, and verifying conservation laws. It is a special case of the dot product with the all-ones vector: S=v⋅1S = \mathbf{v} \cdot \mathbf{1}.

The components and their notation are explained in Notation and representation.

L1 Norm (Manhattan Norm)

The L1 norm sums the absolute values of all vector components:

∣∣v∣∣1=∣v1∣+∣v2∣+⋯+∣vn∣||\mathbf{v}||_1 = |v_1| + |v_2| + \cdots + |v_n|


Also called the Manhattan norm or taxicab norm, it measures distance along axis-aligned paths rather than straight lines. The L1 norm is central to sparse optimization problems, LASSO regression, and compressed sensing, where it promotes solutions with many zero entries. It is always greater than or equal to the L2 norm.

See The general norm and Properties of the norm.

L2 Norm (Euclidean Norm)

The L2 norm is the standard Euclidean length of a vector, identical to the magnitude:

∣∣v∣∣2=v12+v22+⋯+vn2||\mathbf{v}||_2 = \sqrt{v_1^2 + v_2^2 + \cdots + v_n^2}


It is the default norm in most mathematical and engineering contexts. The L2 norm measures straight-line distance from the origin and is used in least squares problems, Ridge regression, and defining orthogonality. The relationship ∣∣v∣∣22=v⋅v||\mathbf{v}||_2^2 = \mathbf{v} \cdot \mathbf{v} connects it to the dot product.

See Magnitude in two and three dimensions and The general norm.

Infinity Norm (Max Norm)

The infinity norm returns the largest absolute component value:

∣∣v∣∣∞=max⁡(∣v1∣,∣v2∣,…,∣vn∣)||\mathbf{v}||_\infty = \max(|v_1|, |v_2|, \ldots, |v_n|)


It measures the worst-case component magnitude and is used in numerical analysis for bounding errors, defining matrix norms, and evaluating convergence criteria. The infinity norm is always less than or equal to the L1 norm and represents the limit of the LpL_p norms as pp approaches infinity.

See The general norm and Properties of the norm.

Two-Vector Operations

The Two Vectors category combines a\mathbf{a} and b\mathbf{b} of the same dimension with eight operations: Vector Addition, Vector Subtraction, the Dot Product, the Cross Product, the Angle Between Vectors, the Distance Between Vectors, Vector Projection and Vector Rejection. The cross product needs three dimensions; the calculator refuses it otherwise.

With a=(1,2,3)\mathbf{a} = (1, 2, 3) and b=(4,5,6)\mathbf{b} = (4, 5, 6): a+b=(5,7,9)\mathbf{a} + \mathbf{b} = (5, 7, 9), a−b=(−3,−3,−3)\mathbf{a} - \mathbf{b} = (-3, -3, -3), a⋅b=32\mathbf{a} \cdot \mathbf{b} = 32, a×b=(−3,6,−3)\mathbf{a} \times \mathbf{b} = (-3, 6, -3), the angle is about 12.93∘12.93^\circ and the distance 27≈5.196\sqrt{27} \approx 5.196. The lesson covers them in Basic vector operations, The dot product and The cross product.

Vector Addition

Vector addition sums corresponding components of two vectors with the same dimensionality:

(A+B)i=ai+bi(\mathbf{A} + \mathbf{B})_i = a_i + b_i


Geometrically, placing vector B\mathbf{B} at the tip of A\mathbf{A} gives the resultant. Addition is commutative (A+B=B+A\mathbf{A} + \mathbf{B} = \mathbf{B} + \mathbf{A}) and associative. The zero vector is the additive identity. Vector addition models superposition of forces, velocities, and displacements in physics.

See Vector addition and Properties of addition.

Vector Subtraction

Vector subtraction computes the component-wise difference:

(A−B)i=ai−bi(\mathbf{A} - \mathbf{B})_i = a_i - b_i


The result vector points from the tip of B\mathbf{B} to the tip of A\mathbf{A}. Subtraction is equivalent to adding the negation: A−B=A+(−B)\mathbf{A} - \mathbf{B} = \mathbf{A} + (-\mathbf{B}). It is used to compute displacement vectors, distances, and relative positions between points.

See Vector subtraction in the basic operations lesson.

Dot Product

The dot product (inner product) of two vectors produces a scalar:

A⋅B=∑i=1naibi=∣∣A∣∣ ∣∣B∣∣cos⁡θ\mathbf{A} \cdot \mathbf{B} = \sum_{i=1}^{n} a_i b_i = ||\mathbf{A}|| \, ||\mathbf{B}|| \cos\theta


A dot product of zero means the vectors are orthogonal (perpendicular). The sign indicates whether the angle between them is acute (positive) or obtuse (negative). The dot product is foundational in projections, computing work in physics, and defining angles in any dimension.

See Algebraic definition, Geometric definition and Properties of the dot product.

Cross Product

The cross product is defined only in 3D and produces a vector perpendicular to both inputs:

A×B=(a2b3−a3b2,  a3b1−a1b3,  a1b2−a2b1)\mathbf{A} \times \mathbf{B} = (a_2 b_3 - a_3 b_2, \; a_3 b_1 - a_1 b_3, \; a_1 b_2 - a_2 b_1)


The magnitude ∣∣A×B∣∣=∣∣A∣∣ ∣∣B∣∣sin⁡θ||\mathbf{A} \times \mathbf{B}|| = ||\mathbf{A}|| \, ||\mathbf{B}|| \sin\theta equals the area of the parallelogram formed by the two vectors. The direction follows the right-hand rule. The cross product is anticommutative: A×B=−(B×A)\mathbf{A} \times \mathbf{B} = -(\mathbf{B} \times \mathbf{A}). It is used in physics for torque, angular momentum, and surface normals.

See Algebraic definition, Geometric interpretation and Direction and the right-hand rule.

Angle Between Vectors

The angle between two nonzero vectors is computed using the dot product:

θ=arccos⁡(A⋅B∣∣A∣∣ ∣∣B∣∣)\theta = \arccos\left(\frac{\mathbf{A} \cdot \mathbf{B}}{||\mathbf{A}|| \, ||\mathbf{B}||}\right)


The result is between 0 and π\pi radians (0 to 180 degrees). An angle of π/2\pi/2 (90 degrees) indicates orthogonality. This formula generalizes the concept of angle to any number of dimensions and is used in similarity measures (cosine similarity), physics, and geometry.

See The angle between vectors and Sign of the dot product.

Distance Between Vectors

The Euclidean distance between two vectors is the magnitude of their difference:

d(A,B)=∣∣A−B∣∣=∑i=1n(ai−bi)2d(\mathbf{A}, \mathbf{B}) = ||\mathbf{A} - \mathbf{B}|| = \sqrt{\sum_{i=1}^{n}(a_i - b_i)^2}


This is the straight-line distance between the two points in nn-dimensional space. Distance is always non-negative, equals zero only when the vectors are identical, and satisfies the triangle inequality. It is the foundation of clustering algorithms like k-means, nearest neighbor methods, and error measurement.

See Distance between vectors in the magnitude lesson.

Vector Projection

The projection of A\mathbf{A} onto B\mathbf{B} gives the component of A\mathbf{A} in the direction of B\mathbf{B}:

projB(A)=A⋅BB⋅B B\text{proj}_{\mathbf{B}}(\mathbf{A}) = \frac{\mathbf{A} \cdot \mathbf{B}}{\mathbf{B} \cdot \mathbf{B}} \, \mathbf{B}


The scalar projection (the coefficient) tells how much of A\mathbf{A} lies along B\mathbf{B}. Projection is central to the Gram-Schmidt process, least squares approximation, and decomposing forces in physics. Together with the rejection, it splits any vector into parallel and perpendicular components.

See Projection onto a vector and Orthogonal projection.

Vector Rejection

The rejection of A\mathbf{A} from B\mathbf{B} is the component of A\mathbf{A} perpendicular to B\mathbf{B}:

rejB(A)=A−projB(A)\text{rej}_{\mathbf{B}}(\mathbf{A}) = \mathbf{A} - \text{proj}_{\mathbf{B}}(\mathbf{A})


The rejection vector is always orthogonal to B\mathbf{B}. Together, projection and rejection form an orthogonal decomposition: A=projB(A)+rejB(A)\mathbf{A} = \text{proj}_{\mathbf{B}}(\mathbf{A}) + \text{rej}_{\mathbf{B}}(\mathbf{A}). This decomposition is used in the Gram-Schmidt process and in computing the distance from a point to a line.

See The orthogonal decomposition, which splits a vector into its projection and its rejection.

Multiple-Vector Operations

The Multiple Vectors category takes two or more vectors, up to ten, and offers six operations: Linear Combination, which needs one coefficient per vector, Span Check, which needs a target vector, Linear Independence, Orthogonality Check, the Gram-Schmidt Process and Matrix Form, which writes the vectors as the columns of a matrix. The + Add Vector button appears only in this category.

With a=(1,0,0)\mathbf{a} = (1, 0, 0) and b=(0,1,0)\mathbf{b} = (0, 1, 0) the combination 2a+1b2\mathbf{a} + 1\mathbf{b} is (2,1,0)(2, 1, 0), the target (3,4,0)(3, 4, 0) lies in their span, and the two are independent and orthogonal; adding a+b\mathbf{a} + \mathbf{b} as a third vector makes the set dependent. The ideas are introduced in Linear combinations, Span and Linear independence.

Linear Combination

A linear combination multiplies each vector by a scalar coefficient and sums the results:

c1v1+c2v2+⋯+ckvkc_1\mathbf{v}_1 + c_2\mathbf{v}_2 + \cdots + c_k\mathbf{v}_k


The set of all possible linear combinations of a set of vectors forms their span. Linear combinations are the fundamental building block of linear algebra: solving systems of equations, expressing transformations, and constructing subspaces all reduce to finding appropriate coefficients.

See Definition and Geometric interpretation in the linear combinations lesson.

Span Check

A span check determines whether a target vector can be expressed as a linear combination of the given vectors. The calculator sets up the system [v1∣v2∣⋯∣vk]x=t[\mathbf{v}_1 | \mathbf{v}_2 | \cdots | \mathbf{v}_k] \mathbf{x} = \mathbf{t} and solves via row reduction.

If a solution exists, the target vector is in the span, and the coefficients are reported. If the system is inconsistent, the target is not reachable from the given vectors. Span checking is fundamental to understanding vector spaces and subspaces.

See Testing whether a vector is in a span and Span.

Linear Independence

A set of vectors is linearly independent if no vector can be written as a linear combination of the others. Equivalently, the only solution to:

c1v1+c2v2+⋯+ckvk=0c_1\mathbf{v}_1 + c_2\mathbf{v}_2 + \cdots + c_k\mathbf{v}_k = \mathbf{0}


is c1=c2=⋯=ck=0c_1 = c_2 = \cdots = c_k = 0. The calculator checks this by forming the matrix with the vectors as columns and computing its rank. If rank equals the number of vectors, they are independent. A set of nn linearly independent vectors in Rn\mathbb{R}^n forms a basis.

See Testing independence: the homogeneous system and Testing independence: the determinant.

Orthogonality Check

A set of vectors is orthogonal if every pair has a dot product of zero. The calculator computes vi⋅vj\mathbf{v}_i \cdot \mathbf{v}_j for all i≠ji \neq j and reports whether all results are zero.

Orthogonal vectors are always linearly independent. An orthogonal set where every vector also has unit length is called orthonormal. Orthogonal and orthonormal bases simplify projections, decompositions, and coordinate transformations because components can be found independently via dot products.

See Orthogonality in the dot product lesson and Orthogonal sets.

Gram-Schmidt Process

The Gram-Schmidt process converts a set of linearly independent vectors into an orthonormal basis. For each vector in sequence:

1. Subtract the projections onto all previously computed basis vectors
2. Normalize the result to unit length

uk=vk−∑j=1k−1projuj(vk),u^k=uk∣∣uk∣∣\mathbf{u}_k = \mathbf{v}_k - \sum_{j=1}^{k-1} \text{proj}_{\mathbf{u}_j}(\mathbf{v}_k), \quad \hat{\mathbf{u}}_k = \frac{\mathbf{u}_k}{||\mathbf{u}_k||}


Gram-Schmidt is the foundation of QR decomposition and is used in numerical methods, signal processing, and constructing coordinate systems.

See The algorithm: two vectors, The algorithm: general case and the worked example.

Matrix Form

The matrix form operation arranges a set of vectors as columns of a matrix. If vectors v1,v2,…,vk\mathbf{v}_1, \mathbf{v}_2, \ldots, \mathbf{v}_k each have nn components, the resulting matrix is n×kn \times k.

This representation connects vector operations to matrix operations: the column space of the matrix equals the span of the vectors, the rank tells how many are linearly independent, and the determinant (for square matrices) indicates whether the vectors form a basis. Matrix form is the bridge between vector geometry and matrix algebra.

See Span and column space and Linear combinations and systems of equations.