Solved.tools: Free Online Calculators & Tools

We use cookies for analytics and advertising. Learn more about our cookie policy

Vector Calculator

Last updated: 27 June 2026

Reviewed by Gavin Meiring, Lead research and primary author ยท Doctoral Candidate (Corporate Governance) ยท Research and drafting assisted by AI

Supports 2D, 3D, and higher-dimensional vectors. Cross product only available for 3D.
Was this helpful?


Vector Calculator

A vector calculator performs operations on two- and three-dimensional vectors, including addition, subtraction, scalar multiplication, dot product, cross product, magnitude, and unit vector calculation. It is used by students in A-level and university physics and mathematics, engineers, and programmers working with graphics, physics simulations, and machine learning.

How to Use the Vector Calculator

  1. Enter the components of your vector or vectors (for example, (3, 4) for a 2D vector or (1, 2, 3) for a 3D vector).
  2. Select the operation you want to perform: magnitude, unit vector, addition, dot product, or cross product.
  3. For binary operations, enter the components of both vectors.
  4. Click Calculate to see the result along with a full step-by-step working.
  5. Use the visualisation tool to see the vectors plotted on a coordinate grid.

The Formula

For vectors A = (a1, a2, a3) and B = (b1, b2, b3):

Magnitude: |A| = sqrt(a1^2 + a2^2 + a3^2)

Unit vector: A_hat = A / |A| = (a1/|A|, a2/|A|, a3/|A|)

Addition: A + B = (a1+b1, a2+b2, a3+b3)

Dot product: A . B = a1b1 + a2b2 + a3*b3 = |A||B|cos(theta)

Cross product: A x B = (a2b3 - a3b2, a3b1 - a1b3, a1b2 - a2b1)

The angle between two vectors: theta = arccos((A . B) / (|A| x |B|))

Real-World Example

Find the dot product, angle between, and cross product of A = (2, 3, 1) and B = (1, -1, 4).

Dot product: A . B = 21 + 3(-1) + 1*4 = 2 - 3 + 4 = 3

|A| = sqrt(4 + 9 + 1) = sqrt(14) = 3.742 |B| = sqrt(1 + 1 + 16) = sqrt(18) = 4.243

Angle: theta = arccos(3 / (3.742 x 4.243)) = arccos(3 / 15.876) = arccos(0.189) = 79.1ยฐ

Cross product: A x B = (34 - 1(-1), 11 - 24, 2*(-1) - 3*1) = (12+1, 1-8, -2-3) = (13, -7, -5)

Vectors in Physics and Engineering

Vectors are used wherever both magnitude and direction must be specified. Velocity, acceleration, force, momentum, and electric field are all vector quantities. In physics, Newton's second law (F = ma) is a vector equation: both force and acceleration have direction. When multiple forces act on an object, they are combined using vector addition. The dot product calculates work (W = F . d), where only the component of force in the direction of motion does work. The cross product calculates torque (tau = r x F) and the magnetic force on a moving charge (F = qv x B). In computer graphics, vectors describe positions, surface normals, and lighting directions. The dot product of a surface normal and a light direction determines how brightly a surface is illuminated. In machine learning, data points are represented as vectors in high-dimensional spaces, and operations like dot products underpin neural network layers.

Frequently Asked Questions

What is the difference between a scalar and a vector? A scalar is a quantity described by a single number (magnitude only), such as temperature, mass, or speed. A vector has both magnitude and direction, such as velocity, force, or displacement. Scalars obey ordinary arithmetic; vectors require component-wise operations and direction-aware rules.

What does the dot product tell you geometrically? The dot product A . B = |A||B|cos(theta), where theta is the angle between the vectors. If the dot product is positive, the vectors point in generally the same direction. If it is zero, they are perpendicular (orthogonal). If it is negative, they point in generally opposite directions. The dot product projects one vector onto another and measures how much they align.

What does the cross product give you? The cross product A x B produces a new vector that is perpendicular to both A and B. Its magnitude equals |A||B|sin(theta), which is the area of the parallelogram formed by A and B. The direction follows the right-hand rule. The cross product is only defined in three dimensions (and in seven dimensions, as a mathematical curiosity).

How do I find the angle between two vectors? Use the formula theta = arccos((A . B) / (|A| x |B|)). Calculate the dot product, divide by the product of the magnitudes, then take the inverse cosine. The result is always between 0ยฐ and 180ยฐ. This method works for vectors in any number of dimensions, unlike the cross product which is specific to 3D.

The tool's own output

The calculator prints five significant figures for every value, which is worth knowing before you compare a result against a hand calculation rounded to three. The table below is what it returns for its own default entry, A = (3, 4, 0), B = (1, 0, 5) and a scalar of 2.

QuantityPrinted value
A + B[4, 4, 5]
A - B[2, 4, -5]
A . B, the dot product3
A x B, the cross product[20, -15, -4]
A, the magnitude of A5
B, the magnitude of B5.099
A, the unit vector of A[0.6, 0.8, 0]
B, the unit vector of B[0.19612, 0, 0.98058]
2A, the scaled A[6, 8, 0]
Angle between A and B83.242 degrees (1.4529 radians)
Parallel?No
Perpendicular?No

Every row can be checked by hand. The dot product is 3 times 1, plus 4 times 0, plus 0 times 5, which is 3. The cross product is (4 times 5 minus 0 times 0, 0 times 1 minus 3 times 5, 3 times 0 minus 4 times 1), which is (20, -15, -4). The magnitude of B is the square root of 26, which is 5.09902 and prints as 5.099 at five significant figures. The angle comes from the inverse cosine of 3 divided by the product of the two magnitudes, and the two headings at the foot of the box test the dot product of the unit vectors against 1 and the dot product of the originals against 0.

Projection, work and torque

Two physical uses turn on the same arithmetic. Work done by a force is the dot product of the force and the displacement, because only the component along the direction of travel contributes. Take a force F = (30, 40, 0) newtons acting through a displacement d = (5, 0, 0) metres.

StepComputationResult
Dot product30 times 5, plus 40 times 0, plus 0 times 0150 joules
Magnitude of Fsquare root of (900 plus 1600)50 newtons
Component along d150 divided by 530 newtons
Cosine of the angle150 divided by (50 times 5)0.6
Angleinverse cosine of 0.653.1301 degrees

The 50-newton force does 150 joules because only 30 of those newtons point along the displacement. Torque is the cross product of a position vector and a force. Take a spanner 0.5 metres long along the x-axis with 120 newtons applied along the y-axis.

StepComputationResult
Position vector r(0.5, 0, 0)metres
Force F(0, 120, 0)newtons
r x F(0 times 0 minus 0 times 120, 0 times 0 minus 0.5 times 0, 0.5 times 120 minus 0 times 0)(0, 0, 60)
Magnitude of the torquelength times perpendicular force60 newton metres

The direction comes from the right-hand rule, which is the part of the cross product that a magnitude alone cannot supply. Rotate the first vector towards the second through the smaller angle and the result points along the thumb. Reverse the order of the two vectors and the result flips sign, which is why the cross product is not commutative and why the order of the factors in a torque calculation carries physical meaning.

The published example, checked

The example above this section works on A = (2, 3, 1) and B = (1, -1, 4) and prints a dot product of 3, magnitudes of 3.742 and 4.243, a cosine of 0.189 and an angle of 79.1 degrees. At full precision the two magnitudes are 3.741657 and 4.242641, the cosine is 0.188982 and the angle is 79.1066 degrees, so the page's figures are those values rounded to three decimals. The unit vector of A is (0.53452, 0.80178, 0.26726) and its magnitude comes to 1, and multiplying it back by 3.741657 returns (2, 3, 1) to the digits shown. The magnitude of the cross product of the same pair is 15.588, which matches the product of the two magnitudes and the sine of the angle, 3.741657 times 4.242641 times 0.981981. That identity is the geometric meaning of the cross product: the number it produces is the area of the parallelogram the two vectors span.

Notation and what the tool will accept

The component reads components separated by commas or spaces and strips round brackets and square brackets, so (3, 4) and 3 4 are both accepted, and it rejects an entry when any part is not a number. It also rejects a pair of vectors whose lengths differ, and it returns the cross product only for three-dimensional vectors, which matches the mathematical position that the cross product is defined in three dimensions and, as a curiosity, in seven. The angle calculation clamps its argument to the range where the inverse cosine is defined, so rounding cannot produce an angle outside the interval from 0 to 180 degrees. The notation used here, including the dot and cross symbols and the vertical bars for magnitude, follows ISO 80000-2, the standard for mathematical signs and symbols.

One item in the steps above does not exist in the component. The fifth step describes a visualisation that plots the vectors on a coordinate grid, and the tool prints a result grid instead. Nothing in the page's own output is affected by that, but a reader who goes looking for the plot will not find it.


Also try these free tools: