Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Vector Calculator

Enter 2D or 3D vectors with whole numbers, decimals or fractions. Get the magnitude as an exact square root, the unit vector with rationalised components, sums, differences, scalar multiples and linear combinations, or x- and y-components from a magnitude and angle.

Write (x, y) or (x, y, z); fractions are fine.

Examples

About the Vector Calculator

Vectors describe quantities with both size and direction: a displacement, a velocity, a force or an electric field. Most work with them comes down to a handful of operations, carried out one component at a time, plus the Pythagorean theorem for length.

This calculator performs those operations exactly. A vector such as ⟨2, −1, 3⟩ has magnitude √14, not just 3.7417, and its unit vector is written ⟨√14/7, −√14/14, 3√14/14⟩ with the roots in the numerators, the form most textbooks expect. For dot products, angles and projections, use the dot product calculator; for perpendicular vectors in space, use the cross product calculator.

What is a vector?

A vector is an ordered list of components, such as ⟨3, 4⟩ in the plane or ⟨1, 2, 2⟩ in space. It can be drawn as an arrow; moving the arrow without turning it does not change the vector. The magnitude is the arrow's length, and the direction is where it points.

Two vectors are added by adding matching components, which corresponds to placing the arrows tip to tail. Multiplying by a scalar stretches or shrinks the arrow, and a negative scalar reverses it. A unit vector has length exactly 1 and is used to describe a pure direction.

How to use the Vector Calculator

  1. Choose the operation: magnitude and unit vector, add, subtract, scalar multiple, linear combination or components.
  2. Type vectors as (x, y) or (x, y, z); fractions such as 1/2 are fine.
  3. Enter any scalars the operation needs.
  4. For components, enter the magnitude and the angle from the positive x-axis in degrees.
  5. Press Calculate and read the result with each step.

Formulas

Magnitude

∣u⃗∣=u12+u22+u32|\vec u| = \sqrt{u_1^2 + u_2^2 + u_3^2}

Unit vector

u^=u⃗∣u⃗∣\hat u = \frac{\vec u}{|\vec u|}

Linear combination

au⃗+bv⃗=⟨au1+bv1, au2+bv2, au3+bv3⟩a\vec u + b\vec v = \langle a u_1 + b v_1,\ a u_2 + b v_2,\ a u_3 + b v_3 \rangle

Components from magnitude and angle

vx=∣v⃗∣cos⁡θ,vy=∣v⃗∣sin⁡θv_x = |\vec v|\cos\theta,\quad v_y = |\vec v|\sin\theta

Worked example: |⟨3, 4⟩| and unit vector

The worked example finds the magnitude and unit vector of u⃗=⟨3,4⟩\vec u = \langle 3, 4 \rangle. The magnitude is 9+16=5\sqrt{9 + 16} = 5, and dividing each component by 5 gives u^=⟨35,45⟩\hat u = \langle \tfrac35, \tfrac45 \rangle.

Its direction angle is atan2⁡(4,3)≈53.13°\operatorname{atan2}(4, 3) \approx 53.13° from the positive x-axis. A quick check confirms the unit vector: (35)2+(45)2=9+1625=1(\tfrac35)^2 + (\tfrac45)^2 = \tfrac{9 + 16}{25} = 1.

The solution below is generated by the same engine that powers the calculator above.

Final answer

∣u⃗∣=5,u^=(35, 45)|\vec u| = 5,\quad \hat u = \left(\frac{3}{5},\ \frac{4}{5}\right)

How we read your problem

Vector magnitude and unit vector using exact components.

u⃗=⟨3,4⟩\vec u = \langle 3, 4 \rangle

Step-by-step solution

  1. Square the components and add them

    ∣u⃗∣2=32+42=25|\vec u|^2 = 3^2 + 4^2 = 25
  2. Take the square root for the magnitude

    ∣u⃗∣=25=5|\vec u| = \sqrt{25} = 5
  3. Divide each component by the magnitude for the unit vector

    u^=u⃗∣u⃗∣=(35, 45)\hat u = \frac{\vec u}{|\vec u|} = \left(\frac{3}{5},\ \frac{4}{5}\right)
  4. Check: the unit vector has length 1

    (0.6)2+(0.8)2≈1(0.6)^2 + (0.8)^2 \approx 1
  5. Direction angle from the positive x-axis

    θ=atan2⁡(4, 3)≈53.13010235∘\theta = \operatorname{atan2}(4,\ 3) \approx 53.13010235^\circ

Formulas used

  • Magnitude

    ∣u⃗∣=u12+u22+u32|\vec u| = \sqrt{u_1^2 + u_2^2 + u_3^2}
  • Unit vector

    u^=u⃗/∣u⃗∣\hat u = \vec u / |\vec u|
  • Linear combination

    au⃗+bv⃗=(aui+bvi)a\vec u + b\vec v = (a u_i + b v_i)

Vectors are added, subtracted and scaled one component at a time. The magnitude comes from the Pythagorean theorem, and dividing by it gives a unit vector of length 1 pointing the same way.

Verification

  • The unit vector's components square and add to 1.

Detailed explanation

Exact magnitudes and rationalised unit vectors

When the sum of squares is not a perfect square, the magnitude is left as a simplified root. For ⟨2,−1,3⟩\langle 2, -1, 3 \rangle the sum is 4+1+9=144 + 1 + 9 = 14, so the magnitude is 14\sqrt{14}. The unit vector divides each component by 14\sqrt{14}, and rationalising gives 214=21414=147\tfrac{2}{\sqrt{14}} = \tfrac{2\sqrt{14}}{14} = \tfrac{\sqrt{14}}{7}.

Fractions in the vector are handled the same way. For ⟨12,13⟩\langle \tfrac12, \tfrac13 \rangle the sum of squares is 1336\tfrac{13}{36}, the magnitude is 136\tfrac{\sqrt{13}}{6}, and the unit vector is ⟨31313,21313⟩\langle \tfrac{3\sqrt{13}}{13}, \tfrac{2\sqrt{13}}{13} \rangle.

Linear combinations

A linear combination au⃗+bv⃗a\vec u + b\vec v scales each vector, then adds them. With u⃗=⟨1,2⟩\vec u = \langle 1, 2 \rangle, v⃗=⟨3,−1⟩\vec v = \langle 3, -1 \rangle, a=2a = 2 and b=−3b = -3, the scaled vectors are ⟨2,4⟩\langle 2, 4 \rangle and ⟨−9,3⟩\langle -9, 3 \rangle, and their sum is ⟨−7,7⟩\langle -7, 7 \rangle.

Combinations like this appear when solving for a resultant force, when expressing one vector in terms of others, and throughout linear algebra, where the set of all combinations of some vectors is called their span.

Resolving into components

Physics problems often give a vector as a magnitude and an angle, such as a 10 N force at 30° above the horizontal. Its components are 10cos⁡30°≈8.66010\cos 30° \approx 8.660 N horizontally and 10sin⁡30°=510\sin 30° = 5 N vertically.

Once forces are in component form, they can be added directly. Converting back uses the magnitude formula and θ=atan2⁡(vy,vx)\theta = \operatorname{atan2}(v_y, v_x), which places the angle in the correct quadrant.

Standard unit vectors i, j and k

Many textbooks write vectors with the standard unit vectors i=⟨1,0,0⟩\mathbf i = \langle 1, 0, 0 \rangle, j=⟨0,1,0⟩\mathbf j = \langle 0, 1, 0 \rangle and k=⟨0,0,1⟩\mathbf k = \langle 0, 0, 1 \rangle. The vector 2i−j+3k2\mathbf i - \mathbf j + 3\mathbf k is the same as ⟨2,−1,3⟩\langle 2, -1, 3 \rangle, so enter it in the calculator as (2, -1, 3).

Writing a vector this way is itself a linear combination: the components are the coefficients of i, j and k. In the plane only i and j are needed, and a term that is missing simply has a coefficient of zero, as in 4i−5k=⟨4,0,−5⟩4\mathbf i - 5\mathbf k = \langle 4, 0, -5 \rangle.

Common mistakes

  • Forgetting to square negative components, or squaring −1 as −1.
  • Dividing only some components by the magnitude when forming the unit vector.
  • Adding vectors with different numbers of components.
  • Using arctan(y/x) for the direction without checking the quadrant.
  • Mixing up the magnitude of a sum with the sum of the magnitudes.

Tips

  • Check a unit vector by confirming that its components square and add to 1.
  • Multiplying by k multiplies the length by |k|.
  • Write vectors in column form when adding by hand so components line up.
  • Use the dot product calculator for angles and projections between vectors.
  • Use the cross product calculator to find a vector perpendicular to two others in space.

Frequently asked questions

How do I find the magnitude of a vector?

Square each component, add the squares and take the square root. The magnitude of ⟨3, 4⟩ is √(9 + 16) = 5.

How do I find a unit vector?

Divide every component by the vector's magnitude. The unit vector of ⟨3, 4⟩ is ⟨3/5, 4/5⟩.

Does the zero vector have a unit vector?

No. Its magnitude is 0, so dividing by it is undefined, and it has no direction.

How do I subtract two vectors?

Subtract matching components: ⟨1, 2⟩ − ⟨4, −5⟩ = ⟨1 − 4, 2 + 5⟩ = ⟨−3, 7⟩.

What is a linear combination of vectors?

It is a sum of scalar multiples, a·u + b·v. For example, 2⟨1, 2⟩ − 3⟨3, −1⟩ = ⟨−7, 7⟩.

How do I find the components of a force at an angle?

Multiply the magnitude by cos θ for the x-component and by sin θ for the y-component, with θ measured from the positive x-axis.

Can I enter 3D vectors with fractions?

Yes. Type a vector such as (1/2, 3, -2/3); results stay exact.

Work with vectors

Choose an operation above and enter your vectors to get exact results with every step.

More math calculators