Cosine Similarity Calculator

Measure how closely two vectors point in the same direction using cosine similarity.

Result
—

How to calculate

Divide the dot product by the product of the magnitudes. The result ranges from −1 for opposite directions to 1 for identical directions.

Worked example

Use First vector 3, 4 · Second vector 3, 0. The result is 0.6.

Input notes

Separate components with commas or spaces. Each component can be an integer, decimal, or fraction.

OpenStax vector and plane equations

Related calculators