Dot product first, then the angle — in the plane or in space.
Dot product, then the angle
Two or three components, either vector.
between (3, 4) and (4, 3)
16.2602°
cos θ = 24 ÷ (5 × 5) = 0.96. They are less than a right angle apart, so they broadly agree in direction.
Angle
16.2602°
0.283794 radians
Dot product u · v
24
the sum of the componentwise products
|u|
5
length of the first
|v|
5
length of the second
cos θ
0.96
the dot product, normalised
cross magnitude
7
the area of the parallelogram they span
Both vectors are drawn from the same origin and scaled to fit, so the picture shows the angle rather than the lengths. A space pair is not drawn: any flat projection of it would show an angle that is not the one reported.
The angle comes from cos θ = (u · v) / (|u| |v|). The dot product carries the sign, and the magnitudes normalise it — which is why two vectors of any length can have the same angle between them.
A dot product of zero means perpendicular, whatever the lengths. That single test is why the dot product appears everywhere from projections to lighting models.
The answer is always between 0° and 180°: this is the unsigned angle, the one you would measure with a protractor. A signed or directed angle needs a chosen orientation, which two vectors alone do not supply.
The cosine is clamped into [−1, 1] before the inverse, so near-parallel vectors return 0° rather than NaN.
What this tool shows
The angle comes from one relation: cos θ = (u · v) / (|u| |v|). A dot product of zero means perpendicular, whatever the lengths — which is why that single test turns up everywhere from projections to lighting models.
The angle between two vectors in 2D or 3D
The dot product, as a separate step
Each vector’s magnitude
The cosine before the inverse is taken
Whether they are perpendicular, parallel or opposed
The cross-product magnitude, and what it measures
Every step shown Perpendicular detected exactly Plane pairs drawn Two or three components
Steps shown; parallel vectors return exactly 0° or 180°.
Updated 7 September 2026 · Works in any browser, no installation
cos θ = (u · v) / (|u| |v|). Take the dot product, divide by both lengths, and take the inverse cosine. For (3,4) and (4,3): the dot product is 24, both magnitudes are 5, so cos θ = 24/25 and θ ≈ 16.26°. A dot product of zero means a right angle, whatever the lengths are.
At a glance
Formula shown
cos \u03b8 = (u \u00b7 v) / (|u| |v|), where u \u00b7 v = \u03a3 u\u1d62v\u1d62 and |u| = \u221a(\u03a3 u\u1d62\u00b2). The angle is arccos of that, always between 0\u00b0 and 180\u00b0.
Scenario support
Checking whether two directions are perpendicular; finding the angle between a force and a displacement; measuring how far apart two directions are in a graphics or physics problem.
Educational estimate
Planning support from the values you enter — not professional advice.
What the dot product means
Multiply matching components and add them up. For (3,4) and (4,3): 3×4 + 4×3 = 24.
Geometrically it measures how much the two vectors agree in direction, scaled by both lengths. Pointing the same way gives a large positive number; pointing opposite ways gives a large negative one; at right angles it gives exactly zero.
That zero is the useful part. Testing perpendicularity needs no square roots, no inverse cosine and no trigonometry at all — just a handful of multiplications and an addition. It is why the dot product appears in almost every geometry routine ever written.
Why divide by the magnitudes
The raw dot product depends on how long the vectors are, and length is not what the question is about.
(1,0) and (2,0) point the same way and have a dot product of 2. (10,0) and (20,0) also point the same way and have a dot product of 200. Same angle, wildly different numbers.
Dividing by both magnitudes strips the lengths out, leaving a number between −1 and 1 that depends only on direction. That number is the cosine of the angle, and the inverse cosine recovers the angle itself.
This is why scaling either vector never changes the answer — something the page’s test suite checks across four thousand generated pairs rather than assuming.
Perpendicular and parallel
Perpendicular: dot product exactly zero, angle exactly 90°. No other test is needed.
Parallel, same direction: cosine 1, angle 0°.
Parallel, opposite direction: cosine −1, angle 180°. Sometimes called antiparallel.
The parallel cases need care in floating point. (2,4) and (1,2) are exactly parallel, but computing their cosine gives 0.9999999999999998, and the inverse cosine of that is not zero — it is about a millionth of a degree, because arccos magnifies error near the ends of its range.
This page tests for parallelism with the cross product instead, which is exactly zero for those vectors, and reports 0° when it is. A millionth of a degree is not a rounding detail when the correct answer is nothing.
The cross product, and what it adds
Where the dot product measures agreement, the cross product measures disagreement. Its magnitude is |u||v|·sin θ, largest when the vectors are perpendicular and zero when they are parallel.
That magnitude is also the area of the parallelogram the two vectors span, which is the geometric reason it vanishes for parallel vectors: a flattened parallelogram has no area.
In three dimensions the cross product is itself a vector, perpendicular to both inputs — which is how a surface normal is computed from two edges. In two dimensions there is no room for such a vector, so what is reported is the scalar determinant.
Between them the two products give the whole picture: the dot gives cos θ, the cross gives sin θ, and their ratio gives the tangent.
Signed angles need more than two vectors
The answer here is always between 0° and 180°. It is the unsigned angle, the one you would measure with a protractor laid between them.
A signed angle — “45° anticlockwise” rather than just “45°” — needs an orientation, and two vectors alone do not supply one. In the plane you can get it from atan2 of the cross and dot products, because the plane has a conventional positive direction.
In three dimensions there is no such convention. “Anticlockwise” depends on which side you are viewing from, so a signed angle needs an axis to be nominated first. That is why this page reports the unsigned angle: it is the one that is well defined without extra information.
Where it gets used
Work in physics. Work is force times displacement times the cosine of the angle between them — which is the dot product. A force at right angles to the motion does no work, because its dot product is zero.
Lighting in graphics. Surface brightness is the dot product of the surface normal and the direction to the light. Facing the light gives 1, edge-on gives 0.
Similarity in machine learning. Cosine similarity between two embedding vectors is exactly the cosine computed here. Comparing documents or search results is this operation at scale.
Projection. The component of one vector along another is (u · v)/|v|, which is the shadow one casts on the other. Every decomposition into components uses it.
Sources and methodology
The definitions are standard linear algebra; these are the references.
Method. The dot product and both magnitudes are computed and displayed as separate steps rather than folded into the answer, because the dot product alone settles the question most readers arrived with. Exactly parallel vectors are detected by the cross product, which is zero for them, rather than by the inverse cosine — near ±1 the arccos magnifies rounding, and (2,4) with (1,2) returned 0.0000012° before that check was added. The suite compares every result against the law of cosines applied to the triangle the two vectors and their difference form. That engine is verified on every change against 82 hand-written assertions, including agreement with the law of cosines on three thousand random plane pairs, and that the angle is symmetric in its two arguments and unchanged by scaling either vector. The count and the per-case breakdown are published on the formula verification page.
Related calculators
Where this goes next:
Central AngleLeave one of radius, arc and angle blank and the page solves for it — with the sector drawn, plus chord, sector area and segment area from the same angle.
Reference AngleThe acute angle to the x-axis — never the y-axis — with the quadrant rule written out using your own numbers and the sign of each trig function beside it.
Coterminal AngleThe principal angle between 0° and 360°, the nearest negative one, and the family θ + 360n they all belong to — reduced by exact division, not by looping.
Complementary and Supplementary AnglesBoth at once, plus the explement — and an honest answer when there is none, since an obtuse angle has no complement and a negative number is not one.
Square RootThe exact square root first — 72 gives 6 root 2 — then the decimal to as many as sixty places, computed on whole numbers rather than a double.
QuaternionExact quaternion arithmetic showing both pq and qp every time, both quotients rather than one, and the rotation a unit quaternion represents with axis, angle, matrix and the gimbal-lock case named.
For rotations in three dimensions rather than a single angle between directions, the Quaternion Calculator handles the composition that Euler angles make awkward.
Educational use disclaimer
This is an educational tool. The angle involves an inverse cosine, so it is computed in double precision and shown to a stated number of places; the dot product and magnitudes are exact for the values entered.
Published the vector angle page showing the dot product as its own step, because 'is the dot product zero' is the perpendicularity test and is what most readers arrive for.
Exactly parallel vectors are detected by the cross product rather than by inverse cosine: (2,4) and (1,2) returned 0.0000012° before that check, since arccos magnifies rounding near the ends of its domain.
Checked against the law of cosines applied to the triangle the two vectors and their difference form, on three thousand random pairs.
Add this calculator to your site
Responsive embed — and private: nothing your visitors type leaves their browser.