Math

Instant, private, and free

Cosine Similarity Calculator.

Calculate the cosine similarity of two three-dimensional vectors.

On-device calculationNo signup
01

Set your values

Results update as you type.

Dot product: 0

Dot product

0.000000
Magnitude 1: 1

Magnitude 1

0.000000
Magnitude 2: 1

Magnitude 2

0.000000
Similarity: 0

Similarity

0.000000

Results update automatically as you type.

Use Cases

Compare vector directions in physics or engineering

Use this calculator to quickly assess how aligned two force or velocity vectors are in 3D space, which is useful in mechanics and vector analysis.

Example: Check if two forces are acting in nearly the same direction by entering their components.

Evaluate similarity in data science or machine learning

When working with 3D feature vectors, cosine similarity helps measure how similar two data points are in terms of orientation, ignoring magnitude.

Example: Compare two 3D feature vectors from a recommendation system.

Frequently Asked Questions

What is cosine similarity?
Cosine similarity measures the cosine of the angle between two vectors, indicating how similar their directions are. It ranges from -1 (opposite) to 1 (same direction), with 0 meaning orthogonal.
How do I use this calculator?
Enter the x, y, and z components for Vector 1 and Vector 2 in the provided fields. The calculator will compute the dot product and magnitudes to give you the cosine similarity value.
What does a cosine similarity of 1 mean?
A value of 1 means the two vectors point in exactly the same direction (they are scalar multiples with positive factor). A value of -1 means they point in opposite directions.

Tips & Common Mistakes

Tips

  • Ensure you enter all six components correctly; missing or zero values will affect the result.
  • If one vector is all zeros, the cosine similarity is undefined because the magnitude is zero. Check for zero vectors.
  • Use the result to understand the angle: arccos(cosine similarity) gives the angle in radians.
  • For vectors with large magnitudes, the cosine similarity focuses on direction, not length.

Common Mistakes to Avoid

  • Entering components in the wrong order (e.g., swapping x and y) will give an incorrect similarity.
  • Forgetting that cosine similarity is undefined if either vector has zero magnitude (all components zero).
  • Assuming cosine similarity equals 1 for identical vectors only if they have the same direction; if one is a negative scalar multiple, it will be -1.

Last updated: August 13, 2026