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
Set Dimensions (2 to 10); every vector takes that many components, and the cross product needs exactly 3. Learn more about the dimension
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
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
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
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 2 to 10; the page opens with 3. 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 to 10 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 5 for the magnitude of (3,4,0) and 32 for (1,2,3)⋅(4,5,6); a vector for addition, subtraction, the cross product, the unit vector, projections and linear combinations, such as (−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.
Most of them are ways of measuring length. For u=(3,4,0) the magnitude, which is the L2 norm, is 5; the L1 norm adds the absolute components, 7; the infinity norm takes the largest, 4; the unit vector divides by the magnitude, (0.6,0.8,0), which is what Normalize does too; and the sum of components is 7. The lesson introduces these measures in Magnitude and the norm.
Vector Magnitude
The magnitude (or length) of a vector v=(v1,v2,…,vn) measures its distance from the origin:
∣∣v∣∣=v12+v22+⋯+vn2
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.
A unit vector has magnitude 1 and indicates direction only. Given a nonzero vector v, the corresponding unit vector is:
v^=∣∣v∣∣v
The standard basis vectors e1,e2,…,en 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.
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 eliminates magnitude terms.
The sum of components adds all entries of a vector:
S=v1+v2+⋯+vn
This operation is useful for checking whether a vector sums to zero (important in certain probability and physics contexts), computing averages when divided by n, and verifying conservation laws. It is a special case of the dot product with the all-ones vector: S=v⋅1.
The L1 norm sums the absolute values of all vector components:
∣∣v∣∣1=∣v1∣+∣v2∣+⋯+∣vn∣
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.
The L2 norm is the standard Euclidean length of a vector, identical to the magnitude:
∣∣v∣∣2=v12+v22+⋯+vn2
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 connects it to the dot product.
The infinity norm returns the largest absolute component value:
∣∣v∣∣∞=max(∣v1∣,∣v2∣,…,∣vn∣)
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 Lp norms as p approaches infinity.
With a=(1,2,3) and b=(4,5,6): a+b=(5,7,9), a−b=(−3,−3,−3), a⋅b=32, a×b=(−3,6,−3), the angle is about 12.93∘ and the distance 27≈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
Geometrically, placing vector B at the tip of A gives the resultant. Addition is commutative (A+B=B+A) and associative. The zero vector is the additive identity. Vector addition models superposition of forces, velocities, and displacements in physics.
Vector subtraction computes the component-wise difference:
(A−B)i=ai−bi
The result vector points from the tip of B to the tip of A. Subtraction is equivalent to adding the negation: A−B=A+(−B). It is used to compute displacement vectors, distances, and relative positions between points.
The dot product (inner product) of two vectors produces a scalar:
A⋅B=i=1∑naibi=∣∣A∣∣∣∣B∣∣cosθ
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.
The cross product is defined only in 3D and produces a vector perpendicular to both inputs:
A×B=(a2b3−a3b2,a3b1−a1b3,a1b2−a2b1)
The magnitude ∣∣A×B∣∣=∣∣A∣∣∣∣B∣∣sinθ 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). It is used in physics for torque, angular momentum, and surface normals.
The angle between two nonzero vectors is computed using the dot product:
θ=arccos(∣∣A∣∣∣∣B∣∣A⋅B)
The result is between 0 and π radians (0 to 180 degrees). An angle of π/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.
The Euclidean distance between two vectors is the magnitude of their difference:
d(A,B)=∣∣A−B∣∣=i=1∑n(ai−bi)2
This is the straight-line distance between the two points in n-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.
The projection of A onto B gives the component of A in the direction of B:
projB(A)=B⋅BA⋅BB
The scalar projection (the coefficient) tells how much of A lies along 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.
The rejection of A from B is the component of A perpendicular to B:
rejB(A)=A−projB(A)
The rejection vector is always orthogonal to B. Together, projection and rejection form an orthogonal decomposition: A=projB(A)+rejB(A). This decomposition is used in the Gram-Schmidt process and in computing the distance from a point to a line.
With a=(1,0,0) and b=(0,1,0) the combination 2a+1b is (2,1,0), the target (3,4,0) lies in their span, and the two are independent and orthogonal; adding a+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+⋯+ckvk
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.
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 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.
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=0
is c1=c2=⋯=ck=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 n linearly independent vectors in Rn forms a basis.
A set of vectors is orthogonal if every pair has a dot product of zero. The calculator computes vi⋅vj for all i=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.
The matrix form operation arranges a set of vectors as columns of a matrix. If vectors v1,v2,…,vk each have n components, the resulting matrix is n×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.
This vector calculator covers single-vector analysis, two-vector operations, and multi-vector computations. For matrix-specific operations like determinants, inverses, LU decomposition, and scalar operations, use the Matrix Operations Calculator.
For solving systems of linear equations with methods like Gaussian elimination and Cramer's Rule, use the Linear Systems Calculator. Related topics include eigenvalues and eigenvectors, singular value decomposition, matrix norms, and linear transformations.